views:

63

answers:

0

I am uploading an image to the web and want it to keep upload even if the app goes into the background.
So by using the beginBackgroundTaskWithExpirationHandler, I start uploading the image and then send my app to the background by pressing the home button.
The image gets uploaded on the website and I can see it but none of the delegate methods (image successfully/Failed to upload) get called.
The app never gets to know if the image was loaded or not. When the app is resumed, the requestFailed (because of timeout) is called, but in reality the request succeeded. So even if the app is in the background Running state, response from network is never received?
Is this true?
And if this is the case, what's the best way to handle this? My guess would be, when the app resumes to foreground check if the photo was uploaded or not and then update the UI accordingly.