Quickstart

VERSION 0.28.2
PUBLIC PREVIEW

The TomTomSDKLocationProvider module provides an interface for obtaining and working with location updates. It provides implementations for getting an actual user location with and without Apple Services, as well as one for simulating locations.

To use the Location module, you need to configure the project and add the dependencies.

Project setup

To use the TomTomSDKLocationProvider module, you will need to do the following:

  1. Configure the project as described in the project setup guide.
  2. Add the TomTomSDKLocationProvider module to your project’s Podfile:
    1TOMTOM_SDK_VERSION = '0.28.2'
    2
    3target 'YourAppTarget' do
    4 use_frameworks!
    5 pod 'TomTomSDKLocationProvider', TOMTOM_SDK_VERSION
    6end
  3. Install the dependencies by executing the following commands in the project directory:
    pod repo-art update tomtom-sdk-cocoapods
    pod install --repo-update
  4. Once the project is set up, import the following framework:
    import TomTomSDKLocationProvider

Existing location providers

The TomTomSDKLocationProvider module provides the basic LocationProvider protocol. All location engines have to adopt this protocol. The TomTomSDKLocationProvider module contains the following location engine implementations:

  1. DefaultCLLocationProvider - relies on the Apple Core Location services.
  2. SimulatedLocationProvider - simulates updates for testing purposes and previewing routes.

Learn more about existing location providers in the Built-in location providers.

Custom location providers

Within the TomTom SDKs, developers are not limited to the provided location providers and can use their own services to record locations, or develop their own custom simulated location updates. Read more about creating your own custom location provider in the Create your own provider guide.

Location validator

LocationValidator defines the interface for checking if the location is fixed or not. The GPS fix status indicates the quality of the signal, or the accuracy and reliability of the location being reported. The TomTomSDKLocationProvider module provides the DefaultLocationValidator or developers can create the custom one.

Location permissions

If the application is going to use user location data, you have to request the correct permissions. In particular, the user must grant location permission before the location provider can be used. Complete instructions to request location permissions on iOS can be found at Requesting authorization for location services. DefaultCLLocationProvider has the location authorization request from the box.