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
Show file tree
Hide file tree
Changes from all 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
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Stripe Terminal enables you to build your own in-person checkout to accept payme
- [Permissions](#permissions-1)
- [Manifest](#manifest)
- [Usage With Expo](#usage-with-expo)
- [Android](#android-2)
- [Configuring the SDK](#configuring-the-sdk)
- [Build](#build)
- [Example Code](#example-code)
- [Initialization](#initialization)
- [Hooks and Events](#hooks-and-events)
Expand Down Expand Up @@ -172,10 +175,38 @@ 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 updates 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/).

### 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 `moshi` lib by adding the following to `android/gradle.properties`:

```
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
Expand All @@ -196,9 +227,9 @@ After [installing](#installation) the SDK, add the [config plugin](https://docs.
}
```

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

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

```
expo run:ios
Expand Down
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 `moshi` lib by adding the following to `android/gradle.properties`:

```
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