user836026 user836026 - 1 month ago 19
iOS Question

How long time usually application is given to finish in background (backgroundTimeRemaining)

I need to get user location update when application is in background. I used "significant change feature" but the problem with significant change it's not accurate.

Hence, to improve accuracy of "significant change" a "little bit" I'm thinking to complement this with

UIApplication:beginBackgroundTaskWithExpirationHandler:
.

Thus, my question is how long usually application is given (the value in
backgroundTimeRemaining
) to run in background.

Answer

Currently (as of iOS 5), the maximum time an app can remain in the background to finish tasks is 10 minutes. This can change in future iOS releases. You can check the value for yourself by logging the return value of [[UIApplication sharedApplication] backgroundTimeRemaining] when your app enters the background.