Reputation: 165
I've been trying to find information about this but can't seem to find anything. I have a few ideas that I'd like to implement and was hoping that I could do background sync even when app isn't in the app switcher. This Stack Qverflow question seems to say that iOS will not let the app wake up and perform tasks if it was force quit by the user. I gave up on that idea, until now.
I have recently installed Dropbox Carousel and have been using it for automatic photo uploads. I expected that I'd have to open the app every once in a while for the photos to upload to Dropbox. However, with it completely closed (force-quitted), while I was at my computer I noticed files being added to Dropbox.
Somehow, Carousel is uploading photos in the background even if the app is nowhere in the app switcher. How is Dropbox able to do it? Am I missing something?
I've noticed this behaviour intermittently, it isn't like a photo immediately uploads, but at certain intervals a batch get uploaded without opening the app at all and without any action by me (the phone was just connected to WiFi with the screen off).
Upvotes: 6
Views: 2603
Reputation: 8111
My best guess is Carousel (and all iOS apps with similar background uploading) uses the Significant-Change Location Service to do the background uploading. This service wakes up the app even if it has been terminated (force-quit).
If you leave the significant-change location service running and your iOS app is subsequently suspended or terminated, the service automatically wakes up your app when new location data arrives. At wake-up time, the app is put into the background and you are given a small amount of time (around 10 seconds) to manually restart location services and process the location data.
The Carousel docs drop additional hints that they're using this technique: "significant change in your iPhone's location".
Upvotes: 3
Reputation: 221
There are a few ways an App might be able to run in background:
The App might be using all of the 3 choices. You can test it out by:
or simply check whether the App listed in each of the above 3 places.
The App will not be listed in the app switcher if not started by the user explicitly.
Upvotes: 2