Skip to main content
These utilities give you fine-grained control over the NFC subsystem. They are used internally by writeSignedInvoice and readSignedInvoice and are exported for advanced use cases.

checkNFCSupport

Returns true if the device has NFC hardware; false otherwise. Does not check if NFC is enabled.

checkNFCEnabled

Returns true if NFC is currently enabled in device settings. Only Android returns meaningful values — on iOS, NFC is always on when supported.

enableNFCReader

Checks support and enabled state, then calls NfcManager.start(). Throws NFCPaymentError if:
  • NFCErrorCode.NOT_SUPPORTED — no NFC hardware
  • NFCErrorCode.NOT_ENABLED — NFC is off
Used internally by readSignedInvoice. You typically do not need to call this directly.

cancelNFCOperation

Cancels any in-progress NFC operation by:
  1. Unregistering tag event listeners
  2. Cancelling any active technology session
  3. Stopping and clearing the active HCE session (if running)
Call this when:
  • The user navigates away while NFC is active
  • You need to restart an NFC session
  • Your component unmounts during an active NFC scan
readSignedInvoice and writeSignedInvoice automatically call cancelNFCOperation before starting a new session, so you don’t need to call it manually between sequential operations on the same screen.