Read and write physical Near Field Communication (NFC) tags, NDEF payloads, and smart poster tags natively.
Read and write physical Near Field Communication (NFC) tags natively. Nativine embeds native CoreNFC (iOS) and Android NFC Adapter bridges, allowing your application to scan NDEF tags, RFID cards, smart posters, and physical asset tags.
NFC scanning connects web software to physical objects. Nativine's native NFC Tag Scanner plugin exposes hardware tag reading directly to web view JavaScript:
To start an NFC tag scanning session from JavaScript, call nativine.nfc.startScan():
// Start reading NFC tag
nativine.nfc.startScan({
alertMessage: 'Hold your iPhone near the NFC tag.',
callback: 'onNfcTagScanned',
onError: 'onNfcScanError'
});
function onNfcTagScanned(tagData) {
console.log("Tag UID:", tagData.id);
console.log("NDEF Payload Text:", tagData.records[0].payloadText);
}
| Parameter | Type | Description |
|---|---|---|
alertMessage | string | Optional. Custom prompt text rendered inside native iOS CoreNFC sheet. |
callback | string | Required. JS callback function receiving parsed NFC NDEF record object. |
Yes. Supported on iPhone 7 and newer running iOS 13+ and all Android devices equipped with NFC hardware chips.
Yes. Call nativine.nfc.writeTag({ text: 'https://yoururl.com' }) to write NDEF records onto physical tags.