Re: [web-nfc] scan() should validate NDEFScanOptions#{recordType,mediaType} (#437)

> Re-reading "Dispatching NFC content" algorithm below suggests that an NDEF message will matches only if it contains a url record and a record with dummy-id.

I understand the same way.

If `[[Id]]` present, must match one of the records `id`, otherwise no match (event never fired), continue with the next reader.
If `[[RecordType]]` present, must match one of the record `recordType`, otherwise no match, continue with the next reader.
If `[[MediaType]]` is given, must match one of the record `mediaType`, otherwise no match, continue with the next reader.
(If all conditions above matched, fire an event).

BTW there is a bug in the algo, `[[Id]]` should be tested against empty string, not for presence.

-- 
GitHub Notification of comment by zolkis
Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/437#issuecomment-558972318 using your GitHub account

Received on Wednesday, 27 November 2019 07:52:48 UTC