Skip to content

Commit

Permalink
Migration Guide Custom URL Scheme (#440)
Browse files Browse the repository at this point in the history
* Add migration guide entry for custom url scheme.

* Add required exported true attribute to xml snippet.

* Update xml snippet to include remove all reference in AndroidManifest.xml to clear internally set intent filters.
  • Loading branch information
sshropshire authored Sep 19, 2023
1 parent 35a9688 commit 6b23f12
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions v6_MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,30 @@ Kotlin:

DropIn handles browser switching internally. Specifying an `<intent-filter />` in `AndroidManifest.xml` is no longer required. Any payment method that requires a browser switch will work automatically.

On the other hand, there are some scenarios that will require you to set a custom URL scheme for browser switch deep linking. For example, if your `applicationId` contains uppercase letters, you will need to override the default deep link configuration set by the DropIn library.

Internally we use a manifest placeholder to support deep linking into `DropInActivity`. You can override the deep link intent filter for `DropInActivity` by placing the following xml snippet in your app's `AndroidManifest.xml`:

```xml
<activity android:name="com.braintreepayments.api.DropInActivity"
android:exported="true"
tools:node="merge"
>
<intent-filter tools:node="removeAll" />
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="my-custom-url-scheme" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
```

You can then set the custom url scheme on `DropInRequest` to align with the overridden `AndroidManifest.xml` value:

```kotlin
dropInRequest.customUrlScheme = "my-custom-url-scheme"
```

Once set, the DropIn SDK will use this custom url scheme when deep linking instead of the default one.

0 comments on commit 6b23f12

Please sign in to comment.