Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add android expo steps to readme #210

Merged
merged 4 commits into from
Mar 30, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions docs/set-up-your-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,43 @@ Please read the [Android documentation](https://developer.android.com/about/vers

## Usage With Expo

_Note: Currently Expo is only supported for usage with iOS, we will resume support for android when expo update its `compileSdkVersion` to 31_
> Note: This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/).

_Note: This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/)._
### Android

For android you'll need to massage your build files in order to properly compile. First in `android/build.gradle` by updating both `compileSdkVersion` and `targetSdkVersion` to at least `31`:

```
buildscript {
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
}
```

Next ensure that jetifier is ignoring the `mochi` lib by adding the following to `android/gradle.properties`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hungry? mochi -> moshi


```
android.jetifier.ignorelist=moshi-1.13.0.jar
```

or

```
android.jetifier.blacklist=moshi-1.13.0.jar
```

Depending on the version of jetifier in use.

### Configuring the SDK

After [installing](#installation) the SDK, 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` or `app.config.js`:

```json
{
expo: {
// ...
"expo": {
"plugins": [
[
"stripe-terminal-react-native",
Expand All @@ -143,14 +170,13 @@ After [installing](#installation) the SDK, add the [config plugin](https://docs.
"bluetoothPeripheralPermission": "Bluetooth access is required in order to connect to supported bluetooth card readers.",
"bluetoothAlwaysUsagePermission": "This app uses Bluetooth to connect to supported card readers."
}
],
]
]
}
}
```

That's it, that will take care of all android and iOS permissioning required for the SDK to function!
### Build

Next, rebuild your app as described in the ['Adding custom native code'](https://docs.expo.io/workflow/customizing/) guide with:

Expand Down