A collection of examples showing off the Mapbox Navigation SDK.
Installation with CocoaPods
git clone https://github.com/mapbox/mapbox-navigation-ios-examples.git
cd mapbox-navigation-ios-examples
- Go to your Mapbox account dashboard and create an access token that has the
DOWNLOADS:READ
scope. PLEASE NOTE: This is not the same as your production Mapbox API token. Make sure to keep it private and do not insert it into any Info.plist file. Create a file named.netrc
in your home directory if it doesn’t already exist, then add the following lines to the end of the file:where YOUR_SECRET_MAPBOX_TOKEN is your Mapbox API token with themachine api.mapbox.com login mapbox password YOUR_SECRET_MAPBOX_TOKEN
DOWNLOADS:READ
scope. The login should always bemapbox
. It should not be your personal username used to create the secret token. - Run
pod repo update && pod install
and open the resulting Navigation-Examples.xcworkspace. - Sign up or log in to your Mapbox account and grab a Mapbox access token.
- Enter your Mapbox access token into the value of the
MBXAccessToken
key within the Info.plist file. Alternatively, if you plan to use this project as the basis for any open source application, read this guide to learn how to best protect your access tokens. - Building and run the Navigation-Examples scheme.
- Add the example to
/Examples
. - Add the example name to the
Constants.swift
. - Run the app.
While we are not able to answer support questions in this repository, below are some helpful resources if you're just getting started with the Mapbox Navigation SDK for iOS: