Skip to content

Commit

Permalink
doc: update install guides (#3227)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfazekas authored Dec 2, 2023
1 parent 4dff424 commit cb02186
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 59 deletions.
23 changes: 4 additions & 19 deletions android/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Supported mapbox libraries

We're only supporting mapbox 10.0 releases. 11.0 beta has experimental support.
We're only supporting mapbox 10.16* and 11.*. The default is 10.16*.
Next release will be 11.* only so we recommend updatign to 11.*

### Adding mapbox maven repo

Expand Down Expand Up @@ -35,31 +36,17 @@ allprojects {
}
```

### Setting Mapbox implementation

Note 10.1 or later only supports mapbox 10 and 11 implementations. So you no longer need to set this variable:

Set `RNMapboxMapsImpl` in `android/build.gradle > buildscript > ext` section

```groovy
buildscript {
ext {
RNMapboxMapsImpl = 'mapbox'
}
}
```

### Using non default mapbox version

*Warning*: If you set a custom version, make sure you revisit, any time you update @rnmapbox/maps. Setting it to earlier version than what we exepect will likely result in a build error.

Set `RNMapboxMapsLibs` in `android/build.gradle > buildscript > ext` section
Set `RNMapboxMapsVersion` in `android/build.gradle > buildscript > ext` section


```groovy
buildscript {
ext {
RNMapboxMapsVersion = '10.6.0'
RNMapboxMapsVersion = '11.0.0'
}
}
```
Expand Down Expand Up @@ -88,8 +75,6 @@ buildscript {
}
```



# Troubleshooting

If you see `2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs` issue see [possible workaround](#workaround-for-2-files-found-with-path-libarm64-v8alibc_sharedso-from-inputs).
Expand Down
31 changes: 5 additions & 26 deletions ios/install.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# iOS Installation

## React-Native > `0.60.0`

The following assumes, that you're using autolinking and installed

`@rnmapbox/maps` via `npm` or `yarn`.

<br/>

Add the following to your `ios/Podfile`:

```
$RNMapboxMapsImpl = 'mapbox'
```


```ruby
Expand All @@ -34,9 +28,6 @@ $RNMapboxMapsImpl = 'mapbox'
You will need to authorize your download of the Maps SDK with a secret access token with the `DOWNLOADS:READ` scope. This [guide](https://docs.mapbox.com/ios/maps/guides/install/#configure-credentials) explains how to configure the secret token under section `Configure your secret token`.



Set the `$RNMapboxMapsImpl` to `mapbox` aka v10 implementation [see bellow for detailed instructions](#mapbox-maps-sdk-v10)

Run `pod install` to download the proper mapbox dependency.

```sh
Expand All @@ -47,7 +38,7 @@ cd ios
pod install
```

If you want to show the user's current location on the map with the [UserLocation](../docs/UserLocation.md) component, you'll need to add the following property to your `Info.plist` (see [Mapbox iOS docs](https://docs.mapbox.com/ios/maps/guides/user-location/#request-temporary-access-to-full-accuracy-location) for more info):
If you want to show the user's current location on the map with the [LocationPuck](../docs/LocationPuck.md) component, you'll need to add the following property to your `Info.plist` (see [Mapbox iOS docs](https://docs.mapbox.com/ios/maps/guides/user-location/#request-temporary-access-to-full-accuracy-location) for more info):

```
<key>NSLocationWhenInUseUsageDescription</key>
Expand All @@ -60,40 +51,28 @@ Read on if you want to edit your Mapbox version or flavor.

<br/>

## Mapbox Maps SDK (v10)

This is the version we recommend.

Check the current version of the SDK [here](https://docs.mapbox.com/ios/maps/overview/).

Add the following to the beginning of your podfile
```ruby
$RNMapboxMapsImpl = 'mapbox'
```

## Using a custom version of the Mapbox SDK

You can also override the version to use. *Warning:* if you set a version, then later update, the `rnamapbox/maps` library it's possible that you'll end up using Mapbox older version than supported. Make sure you revise this value with `@rnmapbox/maps` updates. Also note that for 11.0 or later versions you'll need to set `$RNMapboxMapsUseV11 = true`, see bellow

```ruby
# Warning: only for advanced use cases, only do this if you know what you're doing.
# $RNMapboxMapsVersion = '~> 10.12.0'
# $RNMapboxMapsVersion = '~> 10.16.2'
```

<br/>

## V11 support

We have experimental support for mapbox 11 beta.
We have support for mapbox 11.

Add the following to your Podfile:

```ruby
$RNMapboxMapsUseV11 = true # use 11 version
$RNMapboxMapsVersion = '= 11.0.0-beta.5'
$RNMapboxMapsVersion = '= 11.0.0'
```

If using expo managed workflow, set the "RNMapboxMapsVersion" variable and the "RNMapboxMapsUseV11" variable to `true`. See the [expo guide](/plugin/install.md)
If using expo managed workflow, set the "RNMapboxMapsVersion" variable. See the [expo guide](/plugin/install.md)

## Troubleshooting

Expand Down
20 changes: 6 additions & 14 deletions plugin/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ Install the latest release:
expo install @rnmapbox/maps
```

## Installing other versions
Replace `@rnmapbox/maps` with the following to install other versions:
- `rnmapbox/maps#main` installs the latest source from git

## Plugin Configuration

After installing this package, add the [config plugin](https://docs.expo.io/guides/config-plugins/) to the [`plugins`](https://docs.expo.io/versions/latest/config/app/#plugins) array of your `app.{json,config.js,config.ts}`:
Expand All @@ -24,15 +20,15 @@ After installing this package, add the [config plugin](https://docs.expo.io/guid
[
"@rnmapbox/maps",
{
"RNMapboxMapsImpl": "maplibre"
"RNMapboxMapsVersion": "11.0.0"
}
]
]
}
}
```

For `mapbox` or `mapbox-gl` you'll need to provide `RNMapboxMapsDownloadToken` as well. This secret token requires the `DOWNLOADS:READ` scope. You can refer to the [iOS guide](https://docs.mapbox.com/ios/maps/guides/install/#configure-credentials), which explains how to configure this token under the section `Configure your secret token`.
You'll need to provide `RNMapboxMapsDownloadToken` as well. This secret token requires the `DOWNLOADS:READ` scope. You can refer to the [iOS guide](https://docs.mapbox.com/ios/maps/guides/install/#configure-credentials), which explains how to configure this token under the section `Configure your secret token`.

```json
{
Expand All @@ -41,7 +37,6 @@ For `mapbox` or `mapbox-gl` you'll need to provide `RNMapboxMapsDownloadToken` a
[
"@rnmapbox/maps",
{
"RNMapboxMapsImpl": "mapbox",
"RNMapboxMapsDownloadToken": "sk.ey...qg"
}
]
Expand Down Expand Up @@ -71,7 +66,7 @@ Next, rebuild your app as described in the ["Adding custom native code"](https:/

### Advanced Configuration

For `mapbox` or `mapbox-gl` on iOS it's possible to overwrite the native SDK version with `RNMapboxMapsVersion`:
It's possible to overwrite the native SDK version with `RNMapboxMapsVersion`:

```json
{
Expand All @@ -80,8 +75,7 @@ For `mapbox` or `mapbox-gl` on iOS it's possible to overwrite the native SDK ver
[
"@rnmapbox/maps",
{
"RNMapboxMapsImpl": "mapbox",
"RNMapboxMapsVersion": "10.XX.XX",
"RNMapboxMapsVersion": "10.16.2",
"RNMapboxMapsDownloadToken": "sk.ey...qg"
}
]
Expand All @@ -90,7 +84,7 @@ For `mapbox` or `mapbox-gl` on iOS it's possible to overwrite the native SDK ver
}
```

If using V11, on iOS, you can use property `RNMapboxMapsUseV11`, see [the ios guide](/ios/install.md):
To use V11 just set the version to a 11 version, see [the ios guide](/ios/install.md):

```json
{
Expand All @@ -99,10 +93,8 @@ If using V11, on iOS, you can use property `RNMapboxMapsUseV11`, see [the ios gu
[
"@rnmapbox/maps",
{
"RNMapboxMapsImpl": "mapbox",
"RNMapboxMapsVersion": "11.XX.XX",
"RNMapboxMapsVersion": "11.0.0",
"RNMapboxMapsDownloadToken": "sk.ey...qg",
"RNMapboxMapsUseV11": true
}
]
]
Expand Down

0 comments on commit cb02186

Please sign in to comment.