Cllocationmanager not updating
The When In Use key allows the app to receive location updates only when the app is in the foreground.
Each of these Strings has a corresponding authorization method that needs to be called, When In Use or Alway (i.e. *Note: adding the keys without explicitly asking for authorization fails as well Here are the corresponding methods: *Note: Don’t forget to add the key in the app’s .plist and to give it a string, otherwise the authorization UIAlert View won’t show and the process won’t start.The explicitly starting and ending of the background tasks inc. Link the starting and ending of the background tasks to the Location Manager updates.Object to save the returned values in order to use them later.Other than that we have the Core Location Manager delegate methods and five other important methods to start, stop, restart and terminate the process as well as a method that will be triggered through a local NSNotification when the app goes into the background.- (void)start Location Tracking // Stop the location Manager and the process completely - (void)stop Location Tracking //Restart the location Manager - (void) restart Location Updates //Stop the location Manager -(void)stop Location Delay By10Seconds // This Method will be called as soon as the app goes into the background // (Which is done through the "[NSNotification Center default Center] add Observer" method with the key // "UIApplication Did Enter Background Notification //" in the "name" parameter, should be implemented in the init method).
But first things first, before starting any of the steps above, we must first check if the app has background authorization, as it might be that the user has disabled the background services: UIAlert View * alert; //We have to make sure that the Background app Refresh is enabled for the Location updates to work in the background.