Getting Started

This section provides an overview of the steps required to install and configure the Navigation SDK, enabling developers to add advanced turn-by-turn navigation capabilities to their iOS applications. Whether you are building a ride-sharing app, a delivery app, or any other app that requires navigation functionality, this guide will help you get up and running quickly. By the end of this guide, you will have a basic navigation app that you can build upon to add your own custom features.

Prerequisites and Requirements for Using the SDK

Before using the iOS Navigation SDK, ensure that your development environment meets the following requirements:

  1. Xcode 13.2.1

  2. Carthage v0.38 or above

  3. Swift 5.5.2

  4. Minimum deployment target: iOS 11.0

  5. Access Key: if you don’t have your Access Key yet, don’t hesitate to contact us

Please note that using an outdated version of any of the above tools may result in compatibility issues and may not be supported by the Navigation SDK.

Configure public token

To configure your public access token, open your project's Info.plist file and add an NBMapAccessKey key whose value is your public access token.

Set permissions

Users expect the SDK to continue to track the user’s location and deliver audible instructions even while a different application is visible or the device is locked. To do this, Make sure you have added the NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription into the Info tab.

Installation Instructions

Installing the iOS navigation SDK in the iOS development environment is a prerequisite for adding navigation features to an application. In this process, developers will need to configure their Xcode project settings and add the necessary dependencies to their projects. This introduction will provide an overview of the steps required to install the iOS navigation SDK, enabling developers to integrate advanced navigation capabilities into their iOS applications.

Add the Dependency

Carthage

Carthage is a dependency manager for iOS projects that simplifies integrating third-party libraries. The Carthage section in the iOS Navigation SDK includes all necessary dependencies, such as NbMapDirection and NbmapCoreNavigation, for the Navigation SDK to function properly. It streamlines the integration of turn-by-turn navigation into an iOS app.

Install Carthage

from https://github.com/Carthage/Carthage#installing-carthage

There are various methods to facilitate Carthage installation

Homebrew(recommend)

You can use Homebrew and install the Carthage tool on your system simply by running brew update and brew install Carthage. (note: if you previously installed the binary version of Carthage, you should delete /Library/Frameworks/CarthageKit.framework). Install carthage

1brew install carthage
ios-sdk-1

Installer:

To employ this method, download and execute the Carthage.pkg file corresponding to the latest release, and adhere to the instructions presented on-screen. In scenarios where the command-line interface (CLI) is utilized for pkg installation, executing sudo chown -R $(whoami) /usr/local may be required initially.

MacPorts:

To employ MacPorts for Carthage installation, execute the following commands: sudo port selfupdate and sudo port install carthage. Note: In cases where the binary version of Carthage was installed previously, it is imperative to remove /Library/Frameworks/CarthageKit.framework.

Source Compilation:

For developers interested in utilizing the latest development version (which may potentially exhibit high instability or incompatibility), clone the master branch of the repository and execute the make install command. This method necessitates Xcode 10.0 (Swift 4.2) as a prerequisite.

Install SDK via Carthage

To install NbmapNavigation framework using (Carthage)[https://github.com/Carthage/Carthage/] v0.38 or above:

  1. (Optional) Clear your Carthage caches, If you have downloaded the sdk before, it is recommended to execute the following commands before updating the SDK:

    rm -rf ~/Library/Caches/carthage/ ~/Library/Caches/org.carthage.CarthageKit/binaries/{Turf,NbmapNavigation,NbMapDirection,NbmapCoreNavigation,Nbmap}
    ios-sdk-2
  2. Create a (Cartfile)[https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#github-repositories] with the following dependency: Create Cartfile in the project directory

    1touch Cartfile
    ios-sdk-3

    Open the Cartfile and Copy the following dependencies in it

    1binary "https://github.com/nextbillion-ai/nextbillion-direction-ios/releases/download/v1/carthage/NbMapDirection.json" ~> 1.1.5
    2binary "https://github.com/nextbillion-ai/nextbillion-map-ios/releases/download/v1/carthage/Nbmap.json" ~> 1.0.2
    3binary "https://github.com/nextbillion-ai/nextbillion-turf-ios/releases/download/v1/carthage/Turf.json" ~> 1.0.0
    4binary "https://github.com/nextbillion-ai/nextbillion-navigation-ios/releases/download/v1/carthage/NbmapCoreNavigation.json" ~> 1.2.3
    5binary "https://github.com/nextbillion-ai/nextbillion-navigation-ios/releases/download/v1/carthage/NbmapNavigation.json" ~> 1.2.3
    ios-sdk-4
  3. Run

    1carthage update --use-xcframeworks
    ios-sdk-5
  4. Link the following framework into your build phases:

    1Turf
    2NbmapNavigation
    3NbMapDirection
    4NbmapCoreNavigation
    5Nbmap
ios-sdk-6
ios-sdk-7
Introduction
Map Display and Navigation
DIDN'T FIND WHAT YOU LOOKING FOR?