Get the App
SLTechnology News&Howtos  ›  Development  › 

Notification of how to unbind the device developed by Wechat

Shulou Source: shulou.com Published: 2022-06-03 15:54:06 10月02日 Update

This article mainly introduces the Wechat development of how to unbind the device notice, the article is very detailed, has a certain reference value, interested friends must read it!

At the beginning of the unbinding, I have been using the mandatory unbinding device notification. Wechat does not specify a limit on the number of times this API is allowed in its developer documentation or in its permissions. It was not until the last two days that it failed to unbind and found that it was limited to 200 times a day. WTF! It's so lame. (it was recently found that it was 100 times.)

Well, try unbinding and setting the notification. Four parameters are required, access_token, ticket, deviceID, and openid. The ticket that ticket thought was the credential of the API call has been returning a-1 system error error. Check the documentation and say that the system is busy. All right, I'll try again later. Half a day later, it's still the same mistake. So I searched the Internet and did not find any relevant knowledge. Before adding a Wechat intelligent hardware development exchange group, went to the inside to ask, only to know that the original ticket is obtained through the jsapi interface to unbind device operation credentials. I'll go again! After a lot of hard work, I finally solved it, and I would also like to thank the people in the group, [great men].

Step 1: reference the js file

Step 2: config interface permission configuration, ready permission verification

Wx.config ({debug: false, beta: true, appId:', timestamp:', nonceStr:', signature:'', jsApiList: [/ / add the function 'openWXDeviceLib',' getWXDeviceTicket']}) Wx.ready (function () {/ / initialize the device library wx.invoke ('openWXDeviceLib', {}, function (res) {/ / alert (res.err_msg);}); wx.error (function (res) {})

Step 3: obtain the unbinding notification credential

Wx.invoke ('getWXDeviceTicket', {"deviceId": nobase_id, "type": 2}, function (res) {res.ticket / / is the credential to be obtained})

View Code

Step 4: transfer the acquired ticket to the background, submit the post, and complete the ok.

The above is all the contents of the article "how to unbind device Notification for Wechat Development". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Interfaces devices development credentials permissions content documents knowledge articles errors restrictions busyness value great people interests functions parameters background guys Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi OPPO Reno macOS vpn Shulou Tech Info