createProximityPresentationSession

suspend fun createProximityPresentationSession(activity: Activity, encodedDeviceEngagementString: String, onSessionTerminated: ProximityPresentationSession.OnSessionTerminated? = null): ProximityPresentationSession

Create a proximity based presentation session with a mobile credential holder using ISO 18013-5 based DeviceRetrieval.

This function requires the calling application to have been granted the following bluetooth related permissions.

For Android versions R and below: android.permission.BLUETOOTH android.permission.BLUETOOTH_ADMIN android.permission.ACCESS_FINE_LOCATION android.permission.ACCESS_COARSE_LOCATION

For Android versions above R: android.permission.BLUETOOTH_SCAN android.permission.BLUETOOTH_ADVERTISE android.permission.BLUETOOTH_CONNECT

If the application using this SDK hasn't already tried to use bluetooth before, calling this function will result in a system UI prompt asking the user to grant the application permission to use bluetooth. However, if the user has already been asked for this permission, either through interaction with another part of the application or through a prior call to this function made by the app and they denied the request, then the VerifierException.BluetoothPermissionException exception will be thrown in response until the user explicitly grants the application bluetooth permission in their OS app settings.

Return

The newly created proximity presentation session represented as an instance of ProximityPresentationSession

Parameters

activity

Android activity

encodedDeviceEngagementString

device Engagement String in format "mdoc:base64EncodedString"

onSessionTerminated

callback when a data transport session has been terminated

Throws