Subscribing to location updates

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 the CLLocationManager to not 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 by going through the following steps:

  1. In the MeTracker.iOS project, open the LocationTrackingService.
  2. Add a private field for the CLLocationManager.
  3. Create an instance of the CLLocationMananger in the StartTracking ...

Get Xamarin.Forms Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.