Now that we have prepared the info.plist file for location tracking, it is time to write the actual code that will track the location of the user. If we don't set CLLocationManager so that it doesn't pause location updates, location updates can be paused automatically by iOS when the location data is unlikely to change. In this app, we don't want that to happen because we want to save the location multiple times so that we can establish whether a user visits a particular location frequently. Let's set this up:
- In the MeTracker.iOS project, open LocationTrackingService.
- Add a private field for CLLocationManager.
- Create an instance of CLLocationMananger in the StartTracking method.
- Set PausesLocationUpdatesAutomatically to false.
- Set AllowBackgroundLocationUpdates to true (as shown in the following code) so that the location updates will continue, even when the app is running in...