| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Demo Application for React Native Mapbox
Note: this app is using non-trivial babel/metro configs, so we can consume the maps library from parent directory directly. Regular apps don't need this complicated setup.
Mapbox is the location data platform for mobile and web applications.
Not a Mapbox user yet? Sign up for an account here. Once you’re signed in, all you need to start building is a Mapbox access token. Use this same short code with all of our interactive mapping libraries, Python and JavaScript SDKs, and directly against our REST APIs. You can create and manage your access tokens on your Mapbox Account page.
cd example
Create a file called accesstoken in the root of the example project and just paste in your Mapbox access token. (The accesstoken file is processed in postinstall, so you need to run yarn install after adding/changing accesstoken.)
Install our dependencies using yarn install.
Android: Set up your Mapbox developer keys as described in https://github.com/rnmapbox/maps/blob/main/android/install.md#adding-mapbox-maven-repo (no need to change build.gradle, just set up gradle.properties)
iOS:
cd ios pod install
Open up another tab in your Terminal and run
yarn start
Note: if modules were added to base lib you might need to run yarn start --reset-cache because we're using babel to rewrite imports
If the build fails make sure gradle has permission to build from cli
cd android chmod +x gradlew
You can run this with the react-native cli or Xcode
If you are using nvm, make sure you copy ios/.xcode.env as ios/.xcode.env.local and modify as described inside the file.
If you run into
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/RNMapboxExample.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist
Just run the example from Xcode, it seems to be an issue with RN.
to run detox tests see https://github.com/rnmapbox/maps-docs/?tab=readme-ov-file#example-documentation-process
npx jest __tests__/exportTestInterface.js yarn detox build --configuration ios.debug yarn detox test --configuration ios.debug --debug-synchronization 500 --loglevel trace --record-logs all --take-screenshots all e2e/docScreenshots.e2e.js
| Back | FazBrowse Home | New Git URL |