The latest way to do silent acquisition of unionid, consistent search method and got some conclusions, record
How to get Unionid
The official website proposes three ways
- Call the API of wx.getUserInfo to get two fields iv and encryptedData [note that user authorization is required]
- Obtain the unonid through wx.login , but it must be that the user has followed the change of the public account, and there is a public account of the same subject under the developer account
- The second condition is consistent with, and more is a mobile application only, but also by wx.login acquisition
As shown:
What does it mean to satisfy the unionid condition?
In fact, it is like this: when the main information of the applet is the same as the main information of the account of the WeChat public account, you can silently obtain
two pictures of unionid to explain the problem:
in conclusion
In other words, when the WeChat public account and the subject information in the background of the applet are the same, it is the so-called public account with the subject