Open Nardeep opened 6 months ago
Same issue on our side. Did you find a solution / workaround?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
@K-Leon Hi , we resolved this issue. The issue is in technology type we added the technology in requestTechnology and use the correct write function according to nfc technology. Here is the below code: let technology = await NfcManager.requestTechnology([NfcTech.NdefFormatable, NfcTech.Ndef],
let promise = (technology == "NdefFormatable" ? NfcManager.ndefFormatableHandlerAndroid.formatNdef(bytes) : NfcManager.ndefHandler.writeNdefMessage(bytes))
When tag is empty , then ndef.writeNdefMessage is not working its throwing error : [Error: unsupported tag api]
we are using below code: const writeDataToNfcTag = async (data) => { console.log('data-=-=-',data); try { await NfcManager.requestTechnology(NfcTech.Ndef, { alertMessage: 'Ready to write some NDEF', }); const bytes = Ndef.encodeMessage([Ndef.textRecord(data)]); console.log('bytes-=-=',bytes); if (bytes) { try{ await NfcManager.ndefHandler.writeNdefMessage(bytes);