This tip is if you work with Core Location
and wants to continue receiving location updates while the app is suspended.
You need to add the UIBackgroundModes
key with value location
to the app's Info.plist
. In addition, — this is easy to miss because it was only added in iOS 9 — you want to set CLLocationManager
's allowsBackgroundLocationUpdates
property to true
. In addition to getting updates while the app is suspended, if the app is killed and the device crosses the CLRegion
you are monitoring, the app will be automatically launched. So this property is also useful for toggling that behavior.
Your feedback is valuable: Do you want more nuggets like this? Yes or No
.