微信小程序NFC功能,调用onHCEMessage接口无法触发?
发布于 7 年前 作者 chuang 4176 次浏览 来自 官方Issues

手机型号华为Honor 8,Android版本 8.0.0,微信版本7.0.14,基础版本2.11.1

    wx.startHCE({

      aid_list: [‘F222222222’],

      success:function(res){

        console.log(‘NfcHCECore–>simple::startHCE:’, res)

        that._runCallBack(res.errCode, res.errMsg)

        wx.onHCEMessage(function (res) { // 无法触发

          console.log(‘NfcHCECore–>simple::onHCEMessage:’, res)

          if (res.messageType === 1) {

            wx.sendHCEMessage({data: buffer})

          }

        })

      },

      fail:function(err){

        that.callError(err)

      }

    })

2 回复

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

https://developers.weixin.qq.com/s/Uyw0EHmd71hx

手机型号华为Honor 8,Android版本 8.0.0,微信版本7.0.14,基础版本2.11.1

回到顶部