No Background Updates on iOS 9 - ios

I am implementing an App with continuous background updates on iOS 9. Even with allowsBackgroundUpdates set to YES, AlwaysUsage Description and with proper authorisation i am not getting location updates continuously. I am using Standard Location Services and Significant Location Services but not receiving any location updates when App is in Background. (App is in background/suspended but not terminated). Can anyone let me know if i have missed anything? Thanks in advance.

If your iOS app must keep monitoring location even while it’s in the background, use the standard location service and specify the location value of the UIBackgroundModes key to continue running in the background and receiving location updates. (In this situation, you should also make sure the location manager’s pausesLocationUpdatesAutomatically property is set to YES to help conserve power.) Examples of apps that might need this type of location updating are fitness or turn-by-turn navigation apps

Related

Swift Region Monitoring Local Notification trigger

I'm doing an app to trigger a local notification when a region is entered.
However, sometimes when the phone is locked, the notifications didn't pop up even I've been in the region area for a while. The notification popup will show only when the power/home button is pressed(phone still in locked mode).
In general, all seems to be working except that sometimes the notification will show only when power/home button is pressed to awake the phone although it is still locked.
Hope someone can enlighten me please! =)
According to the developer documentation. In core-location framework, two services can give you the current location information.
The standard location service is a configurable, general-purpose solution for getting location data and tracking location changes for the specified level of accuracy.
The significant-change location service delivers updates only when there has been a significant change in the device’s location, such as 500 meters or more.
You need to use standard location services to keep monitoring location in background
If your iOS app must keep monitoring location even while it’s in the background, use the standard location service and specify the location value of the UIBackgroundModes key to continue running in the background and receiving location updates. (In this situation, you should also make sure the location manager’s pausesLocationUpdatesAutomatically property is set to YES to help conserve power.)

Location Services in iOS 8: Background Modes

There is a Background mode called Location Updates.
If I include the CoreLocation framework, and in my info.plist include the key NSLocationAlwaysUsageDescription and the value being a String with whatever I need to use it for, do I need to tick the background mode for Location Updates? Can I just use it upon authorization? I've tried looking up iOS 8 guides for Core Location as I've never used it before, but nothing touches on this. I don't know what it is used for if you don't have to tick it for getting location in the background.
When you get authorized for the AlwaysUsage, you can get location whenever your code is running. But it won't run on background unless you have activated an appropriate mode for that.
Apple's Programming Guide describes the philosophy of background modes pretty well.

wake up app by region monitoring or signifiacant location change and start location services

My Question is regarding Location Background Services.
I have a situation where i need my app to continuously run in background and provide location updates. Even if app is quit by user/OS, i need the region monitor or significant location change to start my app and then switch to location background service to provide continuous updates.
Is this functionality achievable on iOS?
With iOS you can set background modes for location updates in Info.plist file by just adding a key named "Required background modes" its an array and set its item 0 to "App registers for location updates", this will make your app to continues location updates even if app is in background. But for quit option apple doesn't provide any such facility you can read apple's documentation for this.
https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4
They wrote: "A suspended app does not execute any code and therefore cannot process notifications related to orientation changes, time changes, preferences changes, and many others that would affect the app’s appearance or state."
Which means once we quit our app it is in suspended mode and thus can not monitor for location updates once its suspended.

What happens when app registers for location updates?

I just wanted to know what happens, when i select app registers for location updates under "Required background modes" in Xcode for an IOS app.
VOIP provides aliveTimeOutHandler for specific duration. In same way, whether location services provides any aliveTimeOutHandler method? I am using IOS7
When your app registers for location updates it will periodically check for location changes when in the background. Of course this is just a switch in project settings that enables that bground mode for your app. You need to actually implement the background task (write some code). You can see the accepted answer here on how to achieve this.

CLLocationManger stopUpdatingLocation behaviour

I am working on CLLocationManager. My App is register for Background "App registers for location updates". But When I am calling "stopUpdatingLocation" and went to background my app is not running more (My app become in Inactive state).
Why LocationManager behaves like that? Even my app is register for background location updates.
You have to Read and Check this link.
You have to Some changes in app.plist file like:
1) If your app use on location services to function properly, You have to add location-services to UIRequiredDeviceCapabilities.
2)if your app requires GPS service, you have to add GPS to UIRequiredDeviceCapabilities.
3) if you need to run your app longer then 10 minutes in the background, add location to UIBackgroundModes. Then your location manager will deliver locations beyond the 10-minute-limit.
4)you should also set NSLocationUsageDescription (can also be localized)
Have you used locationManager:didFailWithError: method? The possible reasons were enumerated.

Resources