Skip to content

Commit ab4f53f

Browse files
docs: add app links to android doc (#1059)
1 parent 1149bf6 commit ab4f53f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/docs/introduction.md

+31
Original file line numberDiff line numberDiff line change
@@ -257,3 +257,34 @@ The scheme is the beginning of your OAuth Redirect URL, up to the scheme separat
257257
is `com.myapp://oauth`, then the url scheme will is `com.myapp`. The scheme must be in lowercase.
258258
259259
NOTE: When integrating with [React Navigation deep linking](https://reactnavigation.org/docs/deep-linking/#set-up-with-bare-react-native-projects), be sure to make this scheme (and the scheme in the config's redirectUrl) unique from the scheme defined in the deep linking intent-filter. E.g. if the scheme in your intent-filter is set to `com.myapp`, then update the above scheme/redirectUrl to be `com.myapp.auth` [as seen here](https://github.com/FormidableLabs/react-native-app-auth/issues/494#issuecomment-797394994).
260+
261+
#### App Links
262+
263+
If your OAuth Redirect URL is an [App Links](https://developer.android.com/training/app-links), you need to add the following code to your `AndroidManifest.xml`:
264+
265+
```xml
266+
<activity
267+
android:name="net.openid.appauth.RedirectUriReceiverActivity"
268+
android:exported="true">
269+
<intent-filter android:autoVerify="true">
270+
<action android:name="android.intent.action.VIEW"/>
271+
<category android:name="android.intent.category.DEFAULT"/>
272+
<category android:name="android.intent.category.BROWSABLE"/>
273+
<data android:scheme="https" android:host=example.domain />
274+
</intent-filter>
275+
</activity>
276+
```
277+
278+
Replace `android:host` with the domain of your redirect uri.
279+
280+
You need to add the `manifestPlaceholders` as described in the section above:
281+
282+
```
283+
android {
284+
defaultConfig {
285+
manifestPlaceholders = [
286+
appAuthRedirectScheme: 'example.domain'
287+
]
288+
}
289+
}
290+
```

0 commit comments

Comments
 (0)