Re:Chrome 81: Near Field Communications, Augmented Reality, ...
by magma17 on Wednesday March 11, 2020 @09:31AM
(#22545636)
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?
Re:Chrome 81: Near Field Communications, Augmented Reality, ...
by codemysoul on Wednesday March 11, 2020 @09:50AM
(#22545800)
The 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
With the webnfc.app, you can only write a single NDEF message with single record of either URL or Text, during single interaction.