Example
Parameters
() => WebNfcWindow | undefined
Test seam that supplies the window the check reads
NDEFReader and the
permissions API from. Defaults to the page’s own window. Leave it unset in
product code.Returns
APromise<WebNfcPermissionState>, one of:
WebNfcPermissionState
Scanning is allowed for this origin. A scan started inside a user gesture
proceeds without a prompt.
WebNfcPermissionState
Scanning has not been decided. A scan started inside a user gesture asks the
customer. Also returned as a safe default when the reader exists but the
permission is not queryable.
WebNfcPermissionState
Scanning is blocked for this origin. Only the browser’s site settings can
re-enable it, so present that path rather than retrying the scan.
WebNfcPermissionState
The device exposes no
NDEFReader. Web NFC is not available here; rely on the
redirect source.This reports the origin’s permission, not the outcome of a scan. A scan can
still fail from
"granted" or "prompt" - for example a dismissed prompt or
an empty-tag read. Handle those through
WebNfcError.reason.See also
webNfcTapSource- the source this gates.WebNfcError- the typed failures a scan rejects with.

