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.
To use the Navigation SDK, you will need to do the following:
- 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.
- Configure the project as described in the project setup guide.
- Add the
TomTomSDKRouteReplannerDefaultdependencies in the
Podfileand execute the
pod installcommand to install the pods.
- Once the project is set up and navigation module is added to your target, import the following frameworks:
import TomTomSDKNavigationEngineimport TomTomSDKRoute
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 three parameters:
- navigationKey - the TomTom API key.
- locationEngine - the engine that will be used by navigation
- routeReplanner - the
RouteReplannerthat will be used for replanning the route.
1let configuration = NavigationConfigurationBuilder(2 navigationKey: "<NAVIGATION-KEY>",3 locationProvider: locationEngine,4 routeReplanner: routeReplanner5)6.build()7locationEngine.start()
- Start navigation.
- Stop navigation.
- Update the route.
- Report specific events that occur during the navigation.
self.navigation = Navigation(configuration: configuration)
Navigation.start() method to start processing data or start navigation with route:
1let routePlan = RoutePlan(route: route, routingOptions: options)2let navigationOptions = NavigationOptions(activeRoutePlan: routePlan)3navigation.start(navigationOptions: navigationOptions)
Navigation start can be observed. Notification about successfull navigation process start is sent via
NavigationStartObserver::func didStart(with navigationMode: Navigation.NavigationMode).
Once you start a navigation session,
- Request locations from the provided
LocationProvider. Read more about this protocol in the Location quickstart guide.
- Process the incoming locations and send out various events with modified data, such as map matched locations.
- Send out guidance events once navigation has started with the route.