获取设备票据中参数需传SN 这个SN是怎么获取的
POST https://api.weixin.qq.com/wxa/getsnticket?access_token=ACCESS_TOKEN
wx.requestSubscribeDeviceMessage({
sn: 'xxxx',
snTicket: 'xxxxx',
modelId: 'xxxxx',
tmplIds: ['xxxxx'],
success(res) {
console.log('[wx.requestSubscribeDeviceMessage success]: ', res)
// { 'QCpBsp1TGJ1ML-UIwAIMkdXpPGzxSfwJqsKsvMVs3io': 'accept' }
},
fail(res) {
console.log('[wx.requestSubscribeDeviceMessage fail]: ', res)
}
})
sn这个应该是硬件设备的唯一id需要设备商提供
设备商家提供啊。https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/hardware-device/getSnTicket.html#%E4%BA%91%E8%B0%83%E7%94%A8