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

WeChat Small Program API NFC Ndef label


May 19, 2021 WeChat Mini Program Development Document


Table of contents


Ndef

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

Ndef label


Method:

Ndef.close(Object object)

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

Disconnect

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)


Ndef.connect(Object object)

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

Connect the NFC label

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)


Ndef.offNdefMessage(function callback)

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

Cancel listening to Ndef messages

Parameters

function callback


Ndef.onNdefMessage(function callback)

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

Listen for Ndef messages

Parameters

function callback


Ndef.setTimeout(Object object)

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

Set a timeout

Parameters

Object object

Property Type The default Required Description
timeout number Is Set timeout (ms)
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)


Ndef.writeNdefMessage(Object object)

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

Rewrite the contents of the Ndef label

Parameters

Object object

Property Type The default Required Description
uris Array Whether uri array
texts Array Whether Text array
records Array Whether Array of binary objects, id, type, and payload (all arrayBuffer types)
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)