react-native-mapbox-gl
Version:
A Mapbox GL react native module for creating custom maps
61 lines (33 loc) • 2.14 kB
Markdown
# Manual installation process
_Make sure to follow these directions carefully._
First,
```bash
npm install 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/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/react-native-mapbox-gl/ios/Mapbox.framework` to `Embedded Binaries`. :collision: **Important, make sure you're adding it to general -> `Embedded Binaries` :collision:**
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:
```bash
"${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 **Targets** ⇢ **Deployment Info**, set the minimum version to 8.0.

### 6: Add to project, [see example](../example.js)
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.