Skip to content

API and technology handlers ​

Use the safe scan lifecycle before technology-specific operations. The public TypeScript declarations define method signatures, results and platform availability.

Lifecycle and handlers ​

OperationMethod
Initialize the moduleawait NfcManager.start()
Check device supportawait NfcManager.isSupported()
Check adapter stateawait NfcManager.isEnabled()
Request a technologyawait NfcManager.requestTechnology(NfcTech.Ndef)
Read the discovered tagawait NfcManager.getTag()
End the technology requestawait NfcManager.cancelTechnologyRequest()

Await cleanup before starting another request. Choose the getter or platform method from the technology table, then consult the public declarations for its command signature and result.

For example, during an active NDEF request:

javascript
const tag = await NfcManager.ndefHandler.getNdefMessage();
const records = tag?.ndefMessage ?? [];

getNdefMessage() resolves to a tag result, rather than an array of NDEF records. Handle absent or empty ndefMessage before decoding records.

Android cached tag metadata ​

Android tag results from discovery and getTag() may include these optional, discovery-time fields when the tag supports the corresponding technology:

TechnologyFields
NFC-Aatqa: number[], sak: number
NFC-Vdsfid: number, responseFlags: number
ISO-DEPhistoricalBytes: number[], hiLayerResponse: number[]

Byte values are unsigned (0–255). An unsupported or unavailable field is omitted; check for its presence before using it. These values come from Android's cached tag discovery data and do not trigger another NFC command. The new NFC-A and NFC-V fields and hiLayerResponse are Android-only; historicalBytes can also be reported by iOS ISO 7816 tags.

The 2026-10-09 device record covers representative NFC-A, NFC-V and ISO-DEP over NFC-A metadata. ISO-DEP over NFC-B hiLayerResponse remains unverified.

Released under the MIT License.