registerForNfcDeviceEngagement

fun registerForNfcDeviceEngagement(activity: Activity, listener: ProximityPresentationSessionListener): Boolean

Registers for NFC-based device engagement and enables it.

The provided listener will receive proximity presentation session events. It is safe to call this method multiple times, but only the first listener will receive events and subsequent calls will return false. This function and deregisterForNfcDeviceEngagement should be called from the same activity on the activity lifecycle onResume and onPause.

Return

True if NFC engagement is successfully started. False if already registered or if NFC is not available.

Parameters

activity

The activity from which NFC engagement is initiated.

listener

The listener to receive session events.