@busable/turn-by-turn
v0.5.6
Published
Mapbox React Native SDKs enable interactive maps and real-time, traffic-aware turn-by-turn navigation, dynamically adjusting routes to avoid congestion.
Downloads
278
Maintainers
Readme
@busable/turn-by-turn
Mapbox React Native SDKs enable interactive maps and real-time, traffic-aware turn-by-turn navigation, dynamically adjusting routes to avoid congestion.
Installation
1. Download package
# yarn
yarn add @busable/turn-by-turn
# npm
npm install @busable/turn-by-turn
iOS Specific Instructions
Place your secret token in a .netrc file in your OS root directory.
machine api.mapbox.com login mapbox password <INSERT SECRET TOKEN>
Install pods
cd ios && pod install
Place your public token in your Xcode project's
Info.plist
and add aMBXAccessToken
key whose value is your public access token.Add the
UIBackgroundModes
key toInfo.plist
withaudio
andlocation
if it is not already present. This will allow your app to deliver audible instructions while it is in the background or the device is locked.<key>UIBackgroundModes</key> <array> <string>audio</string> <string>location</string> </array>
Android Specific Instructions
Place your secret token in your android app's top level
gradle.properties
or«USER_HOME»/.gradle/gradle.properties
fileMAPBOX_DOWNLOADS_TOKEN=<YOUR_MAPBOX_DOWNLOADS_TOKEN>
Open up your project-level
build.gradle
file. Declare the Mapbox Downloads API'sreleases/maven
endpoint in the allprojectsrepositories
block.allprojects { repositories { maven { url 'https://api.mapbox.com/downloads/v2/releases/maven' authentication { basic(BasicAuthentication) } credentials { // Do not change the username below. // This should always be `mapbox` (not your username). username = "mapbox" // Use the secret token you stored in gradle.properties as the password password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: "" } } } }
Add Resources To do so create a new string resource file in your app module
(e.g. app/src/main/res/values/mapbox_access_token.xml)
with your public Mapbox API token:<?xml version="1.0" encoding="utf-8"?> <resources xmlns:tools="http://schemas.android.com/tools"> <string name="mapbox_access_token" translatable="false" tools:ignore="UnusedResources">YOUR_MAPBOX_ACCESS_TOKEN</string> </resources>
For more details installation you can read the Official docs of Mapbox.
License
MIT
Made with create-react-native-library