WalletLinkPresentment

Answers a presentation request link — OpenID4VP by reference (openid4vp://, haip://, …) or ISO 18013-7 (mdoc://): a website's "share with wallet" button, or a QR code scanned from another screen (see com.wallet.ScannedCode.PresentationRequest). The SDK runs the whole flow on its own screen: fetch and check the request, the consent sheet, the app's share guard (face check), the answer.

A scanned QR: call start.

when (val scanned = ScannedCode.classify(code)) {
is ScannedCode.PresentationRequest -> WalletLinkPresentment.start(context, sdk, scanned.uri)
…
}

Links from a browser or another app: set sdk once at app start, and add the intent-filter to the SDK's activity in your AndroidManifest.xml (the manifest merger adds it to the activity the SDK declares; xmlns:tools="http://schemas.android.com/tools" on the root element):

<activity
android:name="com.wallet.ui.WalletLinkPresentmentActivity"
android:exported="true"
tools:node="merge">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="openid4vp" />
<data android:scheme="mdoc" />
</intent-filter>
</activity>
// Application.onCreate
WalletLinkPresentment.sdk = App.sdk

Apps that only present scanned QR codes (no intent-filter) are never opened by other apps' links.

A cancel shows "Cancelled" and closes. onClosed tells your verifier when the screen closed.

Properties

Link copied to clipboard
var onClosed: (requestUri: String?) -> Unit?

Called once when the screen closes after a request was started (shared, cancelled or failed), with the request link, on the main thread. For telling your verifier about a cancel. Default: nothing.

Link copied to clipboard

The wallet whose documents are presented. Set it once at app start (Application.onCreate) when links from a browser open the wallet; start sets it too.

Functions

Link copied to clipboard
fun start(context: Context, sdk: WalletSdk, uri: String, sameDevice: Boolean = false)

Open the SDK's presentment screen for a request link.