This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
iOS: Adding options to use in long-running background tasks #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
i'm currently dealing with long-running background tasks on iOS. On iOS versions > 9.0 one can't receive location updates in background in combination with the
UIBackgroundModes
keylocation
in the Info.plist, because theallowsBackgroundLocationUpdates
flag has to be set to true on the used location manager instance (https://developer.apple.com/reference/corelocation/cllocationmanager/1620568-allowsbackgroundlocationupdates). Receiving location updates in background only works by usingbeginBackgroundTaskWithExpirationHandler
, which suspends the background task after about 3 minutes,Furthermore, long-running background tasks which consume location updates can be suspended if the location updates are paused by the location manager. This behavior can be deactivated by setting the
pausesLocationUpdatesAutomatically
flag of the location manager instance to false (https://developer.apple.com/reference/corelocation/cllocationmanager/1620553-pauseslocationupdatesautomatical).It would be nice to have control over these location manager flags to use the plugin in long-running background tasks. Would it be possible to integrate these flags as options?
(tested on iOS 10.2.1)