I'm writing an application that runs in background mode that can track user (so sometimes updates location in background mode) and, by using region monitoring, informs him of nearby points. I do not use the feature of relaunching the application from region monitoring.
Currently, after getting the applicationWillTerminate:
message, I stop location updates and remove all points from region monitoring. I noticed strange behaviour of the application. The following messages (in order like below) are delivered to the application after trying to kill it in multitasking menu:
applicationWillTerminate:
applicationDidEnterBackground:
- (sometimes) one more
locationManager:didUpdateToLocation:fromLocation:
If I don't register background location mode for this application, it is just killed instead.
I'd like application to terminate like other applications after user kills it in the multitasking menu and not get messages from region monitoring (no points are tracked at that moment anyway). Still, I need to be able to use background location mode. The purpose is to minimize the usage of battery. What should I do to achieve that?
Also, why does the application receive applicationDidEnterBackground:
after applicationWillTerminate:
? Is it still running or not after shutting it down from multitasking menu?