Author: Li Jundong
How to make good use of wechat ecological account system?
First of all, we need to clarify a few terms, subject, wechat open platform account, wechat public platform, UnionID, OpenID
entry
The main body
The subject of wechat ecology often refers to the subject of the company. Wikipedia does not have this article. According to the principle of wechat, it is “a legitimate organization certified by the relevant competent authorities”, so the popular point is the company registered in the Industrial and Commercial Bureau. For example, the main company behind QQ and wechat is “Shenzhen Tencent Computer System Co., LTD.”, and the main company behind Douyin, Huoshan and Tik Tok is “Beijing Micro Broadcast Vision Technology Co., LTD.”. Of course, in addition to the company, the main body also includes public institutions, private non-enterprise units and so on. Wechat only needs to provide the main certificate for authentication.
Wechat open platform
Wechat Open platform provides open interfaces and technical support services for application modules of the access platform. The object oriented platform includes mobile applications (iOS, Android, WP), website applications, public accounts, small programs and third-party platforms. The same open platform account can be bound to multiple applications. For different applications under the same open platform account, the UnionID of the same user is unique.
Binding application restrictions for the same open platform account:
- A mobile application
- An authenticated (organization type) account can be bound to a maximum of 50 mobile applications.
- An unauthenticated account can be bound to a maximum of 10 mobile applications.
2. Web apps – One account can apply for up to 10 web apps.
3. Public account – An authenticated (organization type) account can be bound to a maximum of 50 public accounts of the same subject, 5 public accounts of different subjects and 5 public account test numbers. A maximum of 5 new public accounts of different subjects can be bound to a month. – Unauthenticated (personal type) accounts cannot be bound to public accounts or public account test numbers.
4. Applets – An authenticated (organization type) account can be bound to a maximum of 50 applets of the same main body and 5 applets of different main body, and a maximum of 5 applets of different main body can be bound to a month. – Unauthenticated (Personal type) Account The account cannot be bound to applets.
Note: The above “same subject” means that the main information of the public account/small program is the same as that of the open platform; “Different subject” means that the main information of the public account/small program is different from that of the open platform.
Wechat public platform
The content of the public platform is the public account (subscription account, service account and enterprise account) that we contact daily.
Restrictions on registration of official accounts: – One email address can only apply for one official account; – One mobile phone number can be bound to five public numbers. – The maximum number of individual public accounts registered on the same ID card is 1; – The maximum number of registered public accounts for the same enterprise, individual industrial and commercial households and other organizations is 2; – The same government and media type can register and authenticate 50 public accounts.
OpenID
When each user uses different applications (official account, mini program, mobile application, website, etc.), wechat will generate an OpenID for each user for different applications
UnionID
Similar to OpenID and application association, UnionID and open platform account association, the same user, for different applications under the same wechat open platform, UnionID is the same and unique.
To obtain the OpenID
OpenID is obtained silently without user authorization. The client obtains the temporary login credentialcode through wx.login() and sends it back to the developer server. The server invokes code2Session interface with Code + AppID + AppSecret for user OpenID and other data
The authorization process is shown as follows:
Get UnionID
Different from the silent acquisition method of OpenID, user authorization must be obtained when obtaining UnionID, including consent to obtain basic information of the user, follow the public account, authorize to log in to the mobile application, authorize to log in to the website, etc. After obtaining the user authorization, the developer will get the user’s UnionID through the corresponding interface
UnionID fetch interface: – The user is authorized to call wx.getUserInfo directly to get the UnionID from the decrypted data. – if other applications under the same open platform account have been authorized (users have followed the public account, users have been authorized to login the public account or mobile application, etc.), they can directly obtain the user’s UnionID through wx.login + code2Session. (Cloud. GetWXContext in the cloud function) – After the user completes the payment in the small program, the user can directly obtain the UnionID of the user through the getPaidUnionId interface, without user authorization. (Note: The interface is only valid for 5 minutes after the user makes a payment.)
The applets can obtain the list of permissions that have been requested from the user through the wx.getSetting interface – the permissions that have not been requested, except userInfo, can be issued to the user through the interface, and userInfo must be used by the user to click the button to initiate. – Requested permission. When the user rejects permission application and the product logic is blocked, the wx.oepnSetting interface can be called to open the small program setting interface and guide the user to enable permission. Of course, userInfo can continue to initiate permission requests to the user after the permission is rejected.
UnionID communicates with internal data
After obtaining user authorization and UnionID, the user’s mobile phone number can be verified and the UnionID can be used as part of the user information. The convenience to the user is that it is not necessary to verify the mobile phone number every time, but also saves the company a sum of phone service costs. Once through, multi-terminal reuse, APP, small program, H5 activities, We can use wechat ecology to connect all the scenes.
More importantly, the accumulated data can be analyzed in detail and pushed accurately through the massive UnionID accumulated at multiple points. The value of this data is inestimable.
The resources
- Wechat public platform
- Tencent Customer service – open platform
- Tencent customer service – public platform
- The user information
- authorization
- AuthSetting