light-mode-image
Learn
Functions

setDeviceEngagementListener

Sets Listener to be called when NFC device engagement occurs. If the listener is invoked with error, then NFC engagement encountered an error (and can usually be retried). If error is undefined, then engagement was successful and the device engagement data is buffered in memory. Start a presentation from this engagement using;

createProximityPresentationSession({
 // ...other options
 engagementFromNfc: true,
});

NFC is only supported on Android. On any other platform, it will return NfcError.PlatformNotSupported.

Signature

function setDeviceEngagementListener(
  listener: Listener
): Promise<Result<void, MobileCredentialHolderError<PlatformNotSupported>>>

Parameters

Prop

Type

Returns

Promise<Result<void, MobileCredentialHolderError<PlatformNotSupported>>>

A promise that resolves to an ok result once the listener is registered, and to NfcError.PlatformNotSupported on any platform other than Android.

How would you rate this page?

On this page