kolossal7
kolossal7

Reputation: 165

How does Dropbox Carousel sync when the app is closed and force-quit?

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

Answers (2)

mpoisot
mpoisot

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

Chang Kuang
Chang Kuang

Reputation: 221

There are a few ways an App might be able to run in background:

  1. register itself as location-aware App. System would give the App some time to run when you carry your device around and result in location change event.
  2. app can do "background refresh".
  3. app can do "silent content-available" push notification.

The App might be using all of the 3 choices. You can test it out by:

  1. disabling location service: Settings => Privacy => Location Service
  2. disabling background refresh: Settings => General => Background App Refresh
  3. disabling push notification: Settings => Notifications

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

Related Questions