Files

1.4 KiB

iOS Installation

Add Native Mapbox SDK 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.

Add React Native Mapbox SDK Files

In the Xcode's Project navigator, right click on the Libraries folder ➜ Add Files to <...>. Add node_modules/@mapbox/react-native-mapbox-gl/ios/RCTMGL.xcodeproj. Then in Xcode navigate to Build Phases click on it and you should see Link Binary with Libraries, we need to add libRCTMGL.a.

Add Framework Header Search Paths

In the Build Settings of your application target search for FRAMEWORK_SEARCH_PATHS. Add $(PROJECT_DIR)/../node_modules/@mapbox/react-native-mapbox-gl/ios non-recursive to your Framework Search Paths.

Add Run 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"

Checkout the example application to see how it's configured for an example.