Hello,
For some time now I’ve been receiving crash reports from my iOS app that all point to this exception:
Fatal Exception: NSInternalInconsistencyException
this request has been neutered - you can’t call -sendResponse: twice nor after encoding it
I added some logs and saw the following happening:
3 | 1541676998293 | -[AppDelegate application:performFetchWithCompletionHandler:] line 185 $ Starting background fetch
4 | 1541677719526 | -[AppDelegate application:performFetchWithCompletionHandler:] line 185 $ Starting background fetch
5 | 1541677719680 | -[FINDataManager getSignalsForLocation:withCompletionHandler:]_block_invoke_2 line 207 $ Calling background fetch completion handler
6 | 1541677719680 | -[FINDataManager getSignalsForLocation:withCompletionHandler:]_block_invoke_2 line 207 $ Calling background fetch completion handler
(My app is open-source and you can find the code referenced above here)
In AppDelegate application:performFetchWithCompletionHandler:
I make an async call through Backendless SDK. However, it looks like execution is paused and none of the completion blocks (neither “response”, nor “error”) is called until the second system call to AppDelegate application:performFetchWithCompletionHandler:
is made. Then both Backendless requests receive their callbacks at the same time!
Do you have any explanation why this might be happening? I do remember Backendless SDK switching execution of async calls to different threads a while ago.
What is the suggested way for using the SDK for background fetching?