WeChat public platform develops UnionID

高洛峰
Release: 2017-03-03 10:14:55
Original
1341 people have browsed it

WeChat public platform is updated to provide developers with the UnionID mechanism

According to feedback from developers, due to the need for user accounts to be interoperable between multiple public accounts under the same company, the WeChat open platform provides a UnionID mechanism to solve the problem. This problem.

Through the interface for obtaining basic user information, developers can obtain basic user information through OpenID. If the developer has multiple official accounts, the following method can be used to use the UnionID mechanism to transfer users between multiple official accounts. Account interoperability.

1. Bind multiple public accounts to the same WeChat open platform (open.weixin.qq.com) account, that is, under the same Union

2. Obtain the user’s basic information The UnionID in the information interface is used to distinguish the uniqueness of users. However, it should be noted that the official account will only obtain the UnionID after it is bound to the WeChat open platform account. As long as it is a public account under the same WeChat open platform account, the user's UnionID is unique. In other words, the same user has the same UnionID for different applications under the same WeChat open platform account.

1. Register for the WeChat Open Platform

Address: http://open.weixin.qq.com/

The process is omitted.

2. Bind WeChat public account

Click on the "Management Center" at the top, select "Official Account", and then click "Bind Public Account"

WeChat public platform develops UnionID

Only public accounts certified by WeChat can be bound.

3. Obtain basic user information

This is achieved by using the advanced interface to obtain basic user information. For methods, please refer to WeChat Public Platform Development to Obtain Basic User Information

The user information of Fang times obtained under the first official account is as follows:

{ "subscribe": 1, "openid": "oLVPpjqs9BhvzwPj5A-vTYAX3GLc", "nickname": "方倍", "sex": 1, "language": "zh_CN", "city": "广东", "province": "深圳", "country": "中国", "headimgurl": "http://wx.qlogo.cn/mmopen/utpKYf69VAbCRDRlbUsPsdQN38DoibCkrU6SAMCSNx558eTaLVM8PyM6jlEGzOrH67hyZibIZPXu4BK1XNWzSXB3Cs4qpBBg18/0", "subscribe_time": 1375706487, "unionid": "oTBn-jt2RQSHdBoJQYFSdnZo8BBQ" }
Copy after login

The user information of Fang times obtained under the first official account is as follows:

{ "subscribe": 1, "openid": "ouBMEj6WFnUFBIUKe83VD7s7dft9", "nickname": "方倍", "sex": 1, "language": "zh_CN", "city": "广东", "province": "深圳", "country": "中国", "headimgurl": "http://wx.qlogo.cn/mmopen/utpKYf69VAbCRDRlbUsPsdQN38DoibCkrU6SAMCSNx558eTaLVM8PyM6jlEGzOrH67hyZibIZPXu4BK1XNWzSXB3Cs4qpBBg18/0", "subscribe_time": 1375726425, "unionid": "oTBn-jt2RQSHdBoJQYFSdnZo8BBQ" }
Copy after login

Note that the openid of two different user information

is different under different public accounts, but their unionid is the same. Other information is not unique and has no comparative significance. But the basic message is the same.

In this way, we know that the people following the two public accounts are actually the same person.

4. The meaning of UnionID

For companies with multiple accounts, unionid can help identify whether users under different public accounts are the same person. In this way, the services provided to the user under different accounts can be continuous.

You can also remove the number of duplicate following users to facilitate statistics of the true total number of following users.

For more articles related to WeChat public platform development UnionID, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!