Quickstart

VERSION 0.2.1455
PUBLIC PREVIEW

The Navigation SDK for iOS is only available upon request. Contact us to get started.

The Navigation SDK provides a set of tools that allows you to bring a complete navigation experience to your application. It offers two modes of navigation: turn-by-turn navigation and free driving. In this guide you will see how to set up the project to deploy basic navigation features on your simulator or device.

Project set up

To use the Navigation SDK, you will need to do the following:

  1. Get your TomTom API key from the Developer Portal. Instructions to request and use the TomTom API key can be found in the TomTom API key user guide.
  2. Configure the project as described in the project setup guide.
  3. Add the TomTomSDKNavigationEngine dependency in the Podfile and install it by executing the pod install command.
  4. Once the project is set up and navigation module is added to your target, import the following framework:
    import TomTomSDKNavigationEngine
    import TomTomSDKRoute

Creating the Navigation object

Once the Navigation SDK is added to the application, you can create the Navigation object. To do so use the NavigationConfigurationBuilder to create an instance of NavigationConfiguration. It requires 2 parameters:

NavigationConfiguration can be used to specify custom engines and parameters related to continuous route replanning and route deviation.

1let configuration = NavigationConfigurationBuilder(
2 navigationKey: "<NAVIGATION-KEY>",
3 locationEngine: locationEngine,
4 routingService: routingService
5)
6.build()
7locationEngine.start()

Once NavigationConfiguration is initialized, you can create a Navigation object. It is responsible for interacting with and customizing navigation. Navigation is used to:

  • Start navigation.
  • Stop navigation.
  • Update the route.
  • Report specific events that occur during the navigation.
self.navigation = Navigation(configuration: configuration)

Starting navigation

Call the Navigation.start() method to start processing data or start navigation with route:

let routePlan = RoutePlan(route: route, routingOptions: options)
navigation.start(routePlan: routePlan)

Once you start a navigation session, Navigation will:

  1. Request locations from the provided LocationEngine. Read more about this protocol in the Location quickstart guide.
  2. Process the incoming locations and send out various events with modified data, such as map matched locations.
  3. Send out guidance events once navigation has started with the route.

More details how to use navigation can be found in the Turn-by-turn and Free driving guides.

center