2 ms·
I mean, if the nfc event is triggered, this code for (i=0, i<10, i++) writer.write(i) does it write ten times the tag? overwriting every number?
by magma17 7y ago
I mean, if the nfc event is triggered, this code
for (i=0, i<10, i++)
writer.write(i)
does it write ten times the tag? overwriting every number?
- codemysoul 7y agoThe NDEFWriter write()-method currently returns a promise which is resolved on a successful write operation and rejected on a failed write operation, so you would need to use async-await to be able to loop those writes like that. Here is a reference to the Web NFC API Write-operation: https://w3c.github.io/web-nfc/#writing-to-an-nfc-tag https://w3c.github.io/web-nfc/#writing-to-an-nfc-tag