Skip to content

Commit

Permalink
Deep Link Instructions for Same Device Presentation (#21)
Browse files Browse the repository at this point in the history
This adds instructions on configuring the same device presentation on Android apps.
  • Loading branch information
Juliano1612 authored Aug 27, 2024
1 parent 157e47f commit 6056c61
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
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!
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ called in native SDKs.
- [Kotlin SDK](https://github.com/spruceid/mobile-sdk-kt)
- [Swift SDK](https://github.com/spruceid/mobile-sdk-swift)
- [Rust layer](https://github.com/spruceid/mobile-sdk-rs)

## Configuring Deep Links for same device flows

Click [here](./MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/SameDeviceOID4VP.md) to see how to configure the same device OpenID4VP flow.

0 comments on commit 6056c61

Please sign in to comment.