Skip to content

Latest commit

 

History

History
65 lines (36 loc) · 2.29 KB

install.md

File metadata and controls

65 lines (36 loc) · 2.29 KB

Note

If you were using react-native-mapbox-gl before we moved it into the mapbox npm org. You will need to unlink react-native-mapbox-gl and link @mapbox/react-native-mapbox-gl

Manual installation process

Make sure to follow these directions carefully.

First,

npm install @mapbox/react-native-mapbox-gl --save

1: Adding RCTMapboxGL.xcodeproj

In the Xcode's Project navigator, right click on the Libraries folder ➜ Add Files to <...>. Add node_modules/@mapbox/react-native-mapbox-gl/ios/RCTMapboxGL.xcodeproj

2: Adding Mapbox.framework

Select your project in the Project navigator. Click General tab then add node_modules/@mapbox/react-native-mapbox-gl/ios/Mapbox.framework to Embedded Binaries. 💥 Important, make sure you're adding it to general -> Embedded Binaries 💥

Click 'Add other' to open the file browser and select Mapbox.framework.

Select the 'Copy items if needed' checkbox.

3: Adding the script

In the Build Phases tab, click the plus sign and then New Run Script Phase

Open the newly added Run Script and paste:

 "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework/strip-frameworks.sh"

4: Link Binaries with Libraries

In Build Phases tab, click Link Binaries With Libraries and add libRCTMapboxGL.a

5: Update minimum iOS version to 8.0

React Native Mapbox GL doesn't support iOS version less than 8.0. Under TargetsDeployment Info, set the minimum version to 8.0.

6: Add to project, see example

If you already have an iOS Simulator running from before you followed these steps, you'll need to rebuild the project from XCode - automatic refresh won't bring in the changes you made to this build process.