If you need to track the user's location (instead of getting just the current one) you should not constantly poll the current location, because that can be very inefficient and drain the battery quickly.
The reason is that the device may not be moving for long periods of time, or also small changes in location may not be important to your app. For example, if your app is to track lorry drivers around the city, changes below 50m may be ignored in the interest of efficiency.
Instead of active polling, you should use the built-in feature provided in smartphones for reacting to changes in the location. This way the operating system will notify your app if an important location change has occured, to then only process that for your app's purpose. To start tracking in Zebble you should specify the tracking parameters and then invoke the StartTracking() method.
Device.Location.StartTracking(settings);
When you start tracking, the system will raise an event to notify you of any changes. You should handle that event and use it for your app's purposes.
{
// use the newPosition as you want....
}
You can specify any of the following settings.
In Info.plist add the following:
<array>
<string>location</string>
</array>
Auto Pause When Steady (default: true): Whether location updates should be paused automatically when the location is unlikely to change (iOS 6+).
In many apps, if the user location is temporarily not available you may want to ignore it. For instance, there might not be GPS signals available, etc.
But if tracking location accurately is vital in your app and you don't want to ignore error cases, you can handle the PositionError event.
{
// ....
}