From 6056c610677da2328a977119e44caca62516cb81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juliano=20C=C3=A9zar=20Chagas=20Tavares?= Date: Tue, 27 Aug 2024 09:18:28 -0300 Subject: [PATCH] Deep Link Instructions for Same Device Presentation (#21) This adds instructions on configuring the same device presentation on Android apps. --- .../mobile/sdk/ui/SameDeviceOID4VP.md | 39 +++++++++++++++++++ README.md | 4 ++ 2 files changed, 43 insertions(+) create mode 100644 MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/SameDeviceOID4VP.md diff --git a/MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/SameDeviceOID4VP.md b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/SameDeviceOID4VP.md new file mode 100644 index 0000000..9ac6a66 --- /dev/null +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/SameDeviceOID4VP.md @@ -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 `` tag. + +```xml + + + + + + + + +``` + +## 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! diff --git a/README.md b/README.md index 3952128..e5455f1 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file