Attributes | Types | Note |
ndef | String | Corresponds to the Ndef instance, the instance supports reading and writing of NDEF data on NFC tags in NDEF format. |
nfcA | String | Corresponds to the NfcA instance, the instance supports reading and writing in accordance with the NFC-A (ISO 14443-3A) standard. |
nfcB | String | Corresponds to the NfcB instance, the instance supports reading and writing in accordance with the NFC-B (ISO 14443-3B) standard. |
isoDep | String | Corresponds to the IsoDep instance, the instance supports reading and writing in accordance with the ISO-DEP (ISO 14443-4) standard. |
nfcF | String | Corresponds to the NfcF instance, the instance supports reading and writing in accordance with the NFC-F (JIS 6319-4) standard. |
nfcV | String | Corresponds to the NfcV instance, the instance supports reading and writing in accordance with the NFC-V (ISO 15693) standard. |
mifareClassic | String | Corresponds to the MifareClassic instance, the instance supports reading and writing of MIFARE Classic tags. |
mifareUltralight | String | Corresponds to the MifareUltralight instance, the instance supports reading and writing of MIFARE Ultralight tags. |
The method is utilized as NFCAdapter.startDiscovery().
Attributes | Types | Default value | Required | Note |
success | Function | - | Not required | Callback function for successful interface invocation |
fail | Function | - | Not required | Callback function for successful interface invocation |
complete | Function | - | Not required | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
Error Codes | Error Message | Note |
13000 | The device does not support NFC | - |
13001 | The system's NFC switch is not activated. | - |
13010 | An unknown error occurred. | - |
13019 | user is not authorized | User Authorization Denied |
13011 | invalid parameter | Invalid parameter |
13012 | parse NdefMessage failed | Failed to parse the parameter into NdefMessage. |
13021 | NFC discovery already started | NFC scanning has already commenced. |
13018 | NFC discovery has not started | Attempted to halt NFC scanning without initiating it. |
13022 | Tech already connected | The tag has been successfully connected. |
13023 | Tech has not connected | Attempted to disconnect without a tag being connected. |
13013 | NFC tag has not been discovered | No NFC tag was detected. |
13014 | invalid tech | Invalid tag technology. |
13015 | unavailable tech | Failed to acquire the corresponding technology from the tag. |
13024 | function not support | The current tag technology does not support this feature. |
13017 | system internal error | The related read-write operation has failed. |
13016 | connect fail | Connection failed |
The method is utilized as NFCAdapter.stopDiscovery().
Attributes | Types | Default value | Required | Note |
success | function | - | Not required | Callback function for successful interface invocation |
fail | function | - | Not required | Callback function for unsuccessful interface invocation |
complete | function | - | Not required | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
Error Codes | Error Message | Note |
13000 | The device does not support NFC | - |
13001 | The system's NFC switch is not activated. | - |
13010 | An unknown error occurred. | - |
13019 | user is not authorized | User Authorization Denied |
13011 | invalid parameter | Invalid parameter |
13012 | parse NdefMessage failed | Failed to parse the parameter into NdefMessage. |
13021 | NFC discovery already started | NFC scanning has already commenced. |
13018 | NFC discovery has not started | Attempted to halt NFC scanning without initiating it. |
13022 | Tech already connected | The tag has been successfully connected. |
13023 | Tech has not connected | Attempted to disconnect without a tag being connected. |
13013 | NFC tag has not been discovered | No NFC tag was detected. |
13014 | invalid tech | Invalid tag technology. |
13015 | unavailable tech | Failed to acquire the corresponding technology from the tag. |
13024 | function not support | The current tag technology does not support this feature. |
13017 | system internal error | The related read-write operation has failed. |
13016 | connect fail | Connection failed |
The method is employed as Ndef NFCAdapter.getNdef().
The method is implemented as NfcA NFCAdapter.getNfcA().
The method is utilized as NfcB NFCAdapter.getNfcB().
The method is employed as NfcF NFCAdapter.getNfcF().
The method is utilized as NfcV NFCAdapter.getNfcV().
The method is employed as IsoDep NFCAdapter.getIsoDep().
The method is utilized as MifareClassic NFCAdapter.getMifareClassic().
The method is employed as MifareUltralight NFCAdapter.getMifareUltralight().
The method is utilized as NFCAdapter.onDiscovered(function listener).
Attributes | Types | Note |
id | ArrayBuffer | - |
techs | Array | Tech array, used to match which specific standards (such as NfcA instances) can be used to handle NFC cards. |
messages | Array | NdefMessage array, the message format is {id: ArrayBuffer, type: ArrayBuffer, payload: ArrayBuffer}. |
The method is utilized as NFCAdapter.offDiscovered(function listener).
const listener = function (res) { console.log(res) }NFCAdapter.onDiscovered(listener)NFCAdapter.offDiscovered(listener) // The same function object as the listener must be passed in.
Was this page helpful?