-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deep Link Instructions for Same Device Presentation (#21)
This adds instructions on configuring the same device presentation on Android apps.
- Loading branch information
1 parent
157e47f
commit 6056c61
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/SameDeviceOID4VP.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Same Device OpenID4VP | ||
|
||
If you already have the OpenID4VP working on your app, you need to configure a deep link to get the `openid4vp://` URL and start the flow. | ||
|
||
## Configuring the AndroidManifest.xml to Declare Intent Filters | ||
|
||
Add the following inside the `<activity android:name=".MainActivity">` tag. | ||
|
||
```xml | ||
<intent-filter> | ||
<!-- Intent action and categories --> | ||
<action android:name="android.intent.action.VIEW" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
<category android:name="android.intent.category.BROWSABLE" /> | ||
<!-- Deep link data --> | ||
<data | ||
android:scheme="openid4vp" | ||
/> | ||
</intent-filter> | ||
``` | ||
|
||
## Handle the Intent | ||
|
||
Add the following inside the `override fun onCreate(...)` method. | ||
|
||
```kotlin | ||
super.onCreate(savedInstanceState) | ||
|
||
// ... | ||
|
||
val deepLinkUri: Uri? = intent.data | ||
if (deepLinkUri != null) { | ||
// OID4VP flow integration | ||
} | ||
|
||
// ... | ||
``` | ||
|
||
And now your app is ready to handle `openid4vp://` URLs! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters