digitalCredentialsPresentment

suspend fun digitalCredentialsPresentment(protocol: String, data: String, appId: String?, origin: String, preselectedDocuments: List<Document>, source: PresentmentSource): String

Present credentials according to the W3C Digital Credentials API.

Note: this variant with String instead of JsonObject only exists for interoperability with Swift.

Return

a string with JSON with the result, this is a JSON object containing the protocol and data fields in DigitalCredential interface.

Parameters

protocol

the protocol field in the DigitalCredentialGetRequest dictionary.

data

a string with JSON from the data field in the DigitalCredentialGetRequest dictionary.

appId

the id of the application making the request, if available, for example com.example.app on Android or <teamId>.<bundleId> on iOS.

origin

the origin of the requester.

preselectedDocuments

the list of documents the user may have preselected earlier (for example an OS-provided credential picker like Android's Credential Manager) or the empty list if the user didn't preselect.

Throws

if the user dismissed a prompt.

if coroutineContext does not have PromptModel.

if the UI layer hasn't bound any UI for PromptModel.

if the user canceled in a consent prompt.


suspend fun digitalCredentialsPresentment(protocol: String, data: JsonObject, appId: String?, origin: String, preselectedDocuments: List<Document>, source: PresentmentSource): JsonObject

Present credentials according to the W3C Digital Credentials API.

Return

JSON with the result, this is a JSON object containing the protocol and data fields in DigitalCredential interface.

Parameters

protocol

the protocol field in the DigitalCredentialGetRequest dictionary.

data

the data field in the DigitalCredentialGetRequest dictionary.

appId

the id of the application making the request, if available, for example com.example.app on Android or <teamId>.<bundleId> on iOS.

origin

the origin of the requester.

preselectedDocuments

the list of documents the user may have preselected earlier (for example an OS-provided credential picker like Android's Credential Manager) or the empty list if the user didn't preselect.

Throws

if the user dismissed a prompt.

if coroutineContext does not have PromptModel.

if the UI layer hasn't bound any UI for PromptModel.

if the user canceled in a consent prompt.