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

WeChat small program API NFC initialized NFC module


May 19, 2021 WeChat Mini Program Development Document


Table of contents


wx.startHCE(Object object)

Base library 1.7.0 starts to support, and low versions need to be compatible.

Initialize the NFC module.

Parameters

Object object

Property Type The default Required Description
aid_list Array.<string> Is The AID list that needs to be registered with the system
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)

Error

Error code The error message Description
0 Ok Normal
13000 NFC is not supported by the current device
13001 The current device supports NFC, but the system NFC switch is not on
13002 The current device supports NFC, but not HCE
13003 The AID list parameters are in the wrong format
13004 WeChat is not set as the default NFC payment app
13005 The instructions returned are not legal
13006 Registration of the AID failed

The sample code

wx.startHCE({
  aid_list: ['F222222222'],
  success (res) {
    console.log(res.errMsg)
  }
})