Reads an NFC tag and returns the data read from it.
NFCServiceOptionsobject to configure the NFCService request.
A Promise object that resolves to an array containing a single NFCMessage object.
A rejected promise returns a
Use this function to read data from an NFC tag.
- The design pattern of returning an array containing a single
NFCMessageobject instead of just the
NFCMessageobject is intentional. It’s to make extensibility updates easier, in case future enhancements to NFCService include the ability to read multiple NFC tags.
- If an error occurs, the error is returned via a rejected promise. Handle errors in a
- When the user cancels the operation, the promise is rejected with a
NFCServiceFailure.codevalue of USER_DISMISSED.