Introduction

The NextBillion.ai’s iOS Navigation SDK allows users to to prepare routing data and map tiles for regions that need offline route calculation, map matching, navigation, and map rendering. This guide explains how to integrate offline routing data, map tiles, region downloads, and hybrid route requests for building comprehensive offline-navigation capabilities using NextBillion.ai Navigation SDK for iOS 4.0.0 and public NBNavigation APIs.

We start with reviewing the SDK requirements and different components involved for building an iOS app for offline navigation.

Requirements Prerequisites and Runtime Configuration

Before we proceed, make sure that you have:

  • NextBillion.ai Navigation SDK for iOS 4.0.0 or later.

  • NextBillion.ai Nbmaps SDK for iOS 2.2.0. If the app uses Carthage, upgrade the Maps SDK together with Navigation SDK 4.0.0.

  • iOS 13.0 or later.

  • Programming Language: Swift 5

  • A valid NextBillion.ai API key.

Integration Components

Offline Navigation functionality consists of routing data and map tiles. Routing data supports offline route calculation, map matching, and navigation, while map tiles support map rendering.

Data typePurposePrimary APICan fail independently
Routing dataRoute calculation and navigationNBNavigation routing-region APIsYes
Map tilesOffline map display and previewNBNavigation map-region APIsYes
Region catalogDiscover regionId values and display hierarchySync and list, or fetchRegionListsRouting and map catalogs can fail independently

Routing data and map tiles are downloaded, stored, and reported separately, but they use the same regionId to identify a region.

Before You Start

  • Add the required Navigation SDK and Maps SDK packages.

  • Set NGLAccountManager.accessToken = "YOUR_ACCESS_KEY" before SDK usage.

  • Decide the initial route mode and offline download network policy.

  • Configure NBNavigation.NavigationRuntimeConfig before the first initializeOffline call.

  • Use public NBNavigation APIs only. Do not create OfflineNavigationEngine directly or call NGLRegionalOffline.configure.