[Re-posting it here, since I think I posted it in the wrong category earlier, sorry for that]
Hello,
I'm using Dropbox SDK to upload a file after my app is awakened by iOS through a Silent Notification.
The problem is : The transfer begin but my app is killed by iOS before it can finish. I can see its progress when logging the output of restClient:uploadProgress: and it doesn't have the time to finish.
I thought that when making background downloads or uploads, if we used NSURLSession, iOS detects it and wait for it to finish. Do you guys use it in your SDK ?
Interesting facts :
- I don't have any problem when uploading the same file on iCloud with iCloudDocumentSync.
- The problem doesn't occur when the app is not killed before iOS awaken it with Silent Notifications. By killing, I don't mean closing it from the app switcher, but by terminating it with the "Stop" button from Xcode while it's in background (It's the best way I found in order to simulate the fact that sometimes iOS kill your app while it's in background (like after you played a game and iOS freed all the memory it could)).
- I tried to schedule the RunLoop to keep working for 2 minutes, but iOS still kills it.
- I'm on the main thread when I'm doing the upload.
- I didn't fire the UIBackgroundFetchResult completion handler before it was killed.
- The message iOS displays is Xcode devices :
Sep 20 16:32:20 Jbs-iPhone-5 assertiond[69] <Warning>: <BKNewProcess: 0x15662ea00; com.*********.********; pid: 374; hostpid: -1> has active assertions beyond permitted time:
{(
<BKProcessAssertion: 0x156522220> id: 57-6838B6CE-8BAA-4BFD-83C7-BCD5E475779D name: Background Content Fetching (23) process: <BKNewProcess: 0x15662ea00; com.********.*********; pid: 374; hostpid: -1> permittedBackgroundDuration: 30.000000 reason: backgroundContentFetching owner pid:57 preventSuspend preventThrottleDownUI preventIdleSleep preventSuspendOnSleep
)}
Then in my Device logs, I have this crash log :
Application Specific Information:
com.*********.********failed to scene-create after 19.73s (launch took 0.27s of total time limit 20.00s)
Thank you in advance, I really hope you'll be able to help me.
Jean-Baptiste