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 type | Purpose | Primary API | Can fail independently |
|---|---|---|---|
| Routing data | Route calculation and navigation | NBNavigation routing-region APIs | Yes |
| Map tiles | Offline map display and preview | NBNavigation map-region APIs | Yes |
| Region catalog | Discover regionId values and display hierarchy | Sync and list, or fetchRegionLists | Routing 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.NavigationRuntimeConfigbefore the first initializeOffline call. -
Use public
NBNavigationAPIs only. Do not create OfflineNavigationEngine directly or call NGLRegionalOffline.configure.
Check out the repo Nextbillion.ai Offline Navigation iOS Demo for all code examples.