light-mode-image
Learn
Functions

createProximityPresentationSession

Create a proximity-based presentation session with an mDoc holder using device retrieval as per ISO/IEC 18013-5:2021.

If the application using this SDK hasn't tried to use Bluetooth before, calling this function will result in a system UI prompt asking the user to grant Bluetooth permissions to the application. If the user has denied a similar previous permission request (either when interacting with another part of the application or through a prior call to this function) the ProximityPresentationSessionListener#onError will be invoked with MobileCredentialVerifierErrorType#BluetoothPermissionDenied error until the user explicitly grants Bluetooth permissions to the application in their OS app settings.

Signature

function createProximityPresentationSession(
  options: CreateProximityPresentationSessionOptions
): Promise<void>

Parameters

Returns

Promise<void>

A promise that resolves once the session has been created. The session's progress arrives through the onEstablished, onTerminated, and onError callbacks rather than through this result.

Throws

InvalidParams if the provided arguments are missing or invalid.

MobileCredentialVerifierErrorType.SdkNotInitialized if the SDK has not been initialized. (Android only) Thrown synchronously before a session is created. On iOS this is instead delivered to onError on the provided options.

MobileCredentialVerifierErrorType.InvalidLicense if the SDK license is invalid or has expired. (Android only) Thrown synchronously before a session is created. On iOS this is instead delivered to onError on the provided options.

IllegalState (Android only) if the SDK is not ready to create a new session (e.g. a previous session is still being torn down). Thrown synchronously before a session is created; no iOS equivalent.

ActivityRequiredException (Android only) if there is no current foreground activity when the call is made. Thrown synchronously before a session is created; no iOS equivalent.

How would you rate this page?

On this page