We have a React native mobile application which write some data (NDEF) to NTAG 424 DNA. After writing Tag needs to be write locked.
For write locking purpose, used android default method makeReadonly(). But it failing on tag 424 DNA.
I was able to format and Write-lock with NXP tagWriter android application. but not with android API s
Given below is tag info which I used:-
{
"canMakeReadOnly":false,
"id":"043743CE80",
"isWritable":true,
"maxSize":254,
"ndefMessage":[],
"techTypes":[
"android.nfc.tech.IsoDep",
"android.nfc.tech.NfcA",
"android.nfc.tech.Ndef"
],
"type":"NFC Forum Type 4"
}Here is a part of code which Currently using
try{
await NfcManager.writeNdefMessage(bytes)
.then(()=>NfcManager.makeReadOnlyAndroid())
.then((result)=>{ console.log("Make read Only result:->",result);
});
}
catch (ex) { console.warn('exception', ex); _cleanUp();
} The same is working for "NTAG216"
{"canMakeReadOnly": true, "id": "04883C82B25680", "isWritable": true, "maxSize": 868, "ndefMessage": [{"id": "", "payload": [Array], "tnf": 1, "type": [Array]}], "techTypes": ["android.nfc.tech.NfcA", "android.nfc.tech.MifareUltralight", "android.nfc.tech.Ndef"], "type": "NFC Forum Type 2"}
for react native i have also used
https://github.com/whitedogg13/react-native-nfc-manager :- this plugin.