Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deep Link Instructions for Same Device Presentation #28

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,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](./Sources/MobileSdk/ui/SameDeviceOID4VP.md) to see how to configure the same device OpenID4VP flow.
30 changes: 30 additions & 0 deletions Sources/MobileSdk/ui/SameDeviceOID4VP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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 app Info

1. Go to the Info tab
2. Find the "URL Types" section and click on the add symbol (+) to create a new one
3. Fill the "Identifier" field with anything that you want to help you identify this URL type (e.g., OID4VP)
4. Fill the "URL Schemes" field with `openid4vp`

## Handle the Deep Link

Add the following to your `@main struct : App`.

```swift
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.onOpenURL { url in
// OID4VP flow integration
}
}
}
}
```

And now your app is ready to handle `openid4vp://` URLs!
Loading