Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat Small Program API NFC NFCAdapter label


May 19, 2021 WeChat Mini Program Development Document


Table of contents


NFCAdapter

Base library 2.11.2 starts to be supported, and low versions need to be compatible.

Property

Object tech

Label type enumerity

Property Type Description
ndef string Corresponding to NDEF instance, instance supports reading and writing of NDEF data on NDEF formats
nfcA string Corresponding to NFCA instance, instance supports reading and writing of NFC-A (ISO 14443-3A) standards
nfcB string Corresponding to NFCB instance, instance supports reading and writing of NFC-B (ISO 14443-3B) standards
isoDep string Corresponding to the ISODEP instance, instance supports the reading and writing of ISO-DEP (ISO 14443-4) standard
nfcF string Corresponding to NFCF instance, instance supports reading and writing of NFC-F (JIS 6319-4) standard
nfcV string Corresponding to NFCV instance, instance supports reading and writing of NFC-V (ISO 15693) standards
mifareClassic string Corresponding to the MIFARCLASSIC instance, instance supports reading and writing of Mifare Classic tags
mifareUltralight string Corresponding to the MIFAREULTRALIGHT instance, instance supports reading and writing of Mifare UltraLight tags

method:

IsoDep NFCAdapter.getIsoDep()

Basic Branch 2.11.2 Start support, low version needs to do Compatibility

Get the ISODEP instance, instance supports the reading and writing of ISO-DEP (ISO 14443-4) standard

return value

IsoDep


MifareClassic NFCAdapter.getMifareClassic()

Basic Branch 2.11.2 Start support, low version needs to do Compatibility

Get a MIFARECLASSIC instance, instance supports the read and write of the Mifare Classic tag

return value

MifareClassic


MifareUltralight NFCAdapter.getMifareUltralight()

Basic Branch 2.11.2 Start support, low version needs to do Compatibility

Get the MIFAREULTRALIGHT instance, instance supports the read and write of the Mifare UltraLight tag

return value

MifareUltralight


Ndef NFCAdapter.getNdef()

Base library 2.11.2 starts to be supported, and low versions need to be compatible.

Get an example of Ndef that supports the reading and writing of NDF data on NFC labels in NFC format

Returns a value

Ndef


NfcA NFCAdapter.getNfcA()

Base library 2.11.2 starts to be supported, and low versions need to be compatible.

Get an NfcA instance that supports reading and writing to the NFC-A (ISO 14443-3A) standard

Returns a value

NfcA


NfcB NFCAdapter.getNfcB()

Base library 2.11.2 starts to be supported, and low versions need to be compatible.

Get an NfcB instance that supports reading and writing to the NFC-B (ISO 14443-3B) standard

Returns a value

NfcB


NfcF NFCAdapter.getNfcF()

Base library 2.11.2 starts to be supported, and low versions need to be compatible.

Get an NfcF instance that supports reading and writing to the NFC-F (JIS 6319-4) standard

Returns a value

NfcF


NfcV NFCAdapter.getNfcV()

Base library 2.11.2 starts to be supported, and low versions need to be compatible.

Get an NfcV instance that supports reading and writing to the NFC-V (ISO 15693) standard

Returns a value

NfcV


NFCAdapter.offDiscovered(function callback)

Base library 2.11.2 starts to be supported, and low versions need to be compatible.

Cancel listening to NFC Tags

Parameters

function callback

The callback function of


NFCAdapter.onDiscovered(function callback)

Base library 2.11.2 starts to be supported, and low versions need to be compatible.

Listen to NFC Tags

Parameters

function callback

The callback function of

Parameters

Object res
Property Type Description
techs Array An array of techs that matches exactly what criteria (NfcA, etc.) can be used to handle NFC cards
messages Array NdefMessage array


NFCAdapter.startDiscovery(Object object)

Base library 2.11.2 starts to be supported, and low versions need to be compatible.

Parameters

Object object

Property Type The default Required Description
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)


NFCAdapter.stopDiscovery(Object object)

Base library 2.11.2 starts to be supported, and low versions need to be compatible.

Parameters

Object object

Property Type The default Required Description
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)