微信小程序NFC开发connect 从标签上获取对应技术失败是为什么 ? {"errMsg": "writeNdefMessage:fail:unavailable tech", "errCode": 13015, "errno": 1504208}
读取卡片倒是可以 正常,就是写入的时候报13015
const NFCAdapter = wx.getNFCAdapter()
this.NFCAdapter = NFCAdapter
连接NFC标签
const NFCTab = this.NFCAdapter.getNdef()
NFCTab.connect({
success: () => {
wx.showToast({ title: '连接设备成功' })
},
fail: error => {
console.log(error,'==>连接设备失败')
wx.showToast({
title: '连接设备失败',
icon: 'error'
})
},
complete: res => {
console.log(res,'==>connect连接设备回调');
}
})
连接是13015,是什么原因
写入NFC
NFCTab.writeNdefMessage({
uris: ["https://www.baidu.com"],
success: (res) => {
console.log(res,'==>数据写入成功')
},
fail: (error) => {
console.log(error,'==>数据写入失败')
},
complete: res => {
wx.showToast({
title: '请将卡片放入识别区',
icon: 'error'
})
this.closeConnect(NFCTab)
}
})
写入也是13015,是哪里错了
