hw-security / de.cotech.hw.util / NfcStatusObserver / isNfcEnabled

isNfcEnabled

open fun isNfcEnabled():Boolean

Returns true if NFC hardware is available and enabled.

This method will always return false if no NFC hardware is available on the device. You can use SecurityKeyManager#isNfcHardwareAvailable() to check if NFC hardware is available.

open static fun isNfcEnabled(context: Context):Boolean

Returns true if NFC hardware is available and enabled.

This is a static variant of #isNfcEnabled(), it can be used to check if NFC is enabled without creating an instance of NfcStatusObserver. However, in activities that expect NFC interactions, it is generally preferable to handle this dynamically, in case NFC is dynamically enabled or disabled.