1

In iOS, the background fetch has a limit of some period of time during the call of the background fetch. But in android, will the SyncAdapter have the time limit from executing, or will the syncing continue until it's finished.

LittleFunny
  • 8,155
  • 15
  • 87
  • 198

1 Answers1

1

By default it is 30 minutes.

Syncs can be cancelled at any time by the framework. For example a sync that was not user-initiated and lasts longer than 30 minutes will be considered timed-out and cancelled.

SyncAdapters run on a background thread and in executing your OnPerformSync it is up to you to provide any sync transfer limits (time and/or data size).

That said, the OS can call Interrupted on the thread so you need to monitor the thread's Interrupted property or override the OnSyncCanceled methods (both if you are dealing with multiple accounts) to handle the OS's request. Thus you then need to clean up your network connections, preserve your sync state, etc... and return from your OnPerformSync override otherwise the OS can (and will) kill your process.

SushiHangover
  • 73,120
  • 10
  • 106
  • 165