UnionID 解释?

小程序 文章 2020-09-08 14:21 659 0 全屏看文

AI助手支持GPT4.0

UnionID 解释?UnionID explained?

UnionID 解释?

各位大神,哪位能解释一下UnionID机制,需要什么前提才能获取到UnionID,我公众号关联了小程序,可是获取不到.

UnionID 机制说明

如果开发者拥有多个移动应用、网站应用、和公众帐号(包括小程序),可通过 UnionID 来区分用户的唯一性,因为只要是同一个微信开放平台帐号下的移动应用、网站应用和公众帐号(包括小程序),用户的 UnionID 是唯一的。换句话说,同一用户,对同一个微信开放平台下的不同应用,UnionID是相同的。




Dear gods, who can explain the UnionID mechanism, what premise is required to get UnionID? My official account is associated with small programs. However, the unionid mechanism indicates that if a developer has multiple mobile applications, website applications, and public accounts (including applets), unionid can be used to distinguish the uniqueness of users. As long as the mobile applications, web applications and public accounts (including applets) under the same wechat open platform account, the unionid of users is unique. In other words, for the same user, the unionid is the same for different applications under the same wechat open platform.

回答:

青寒:

1,去微信开放平台注册账号

地址:https://open.weixin.qq.com/


2,在开放平台-管理中心,绑定你的公众号和小程序


3,按照再通过你现在的代码获得unionid。

吃鱼先生:

UnionID是对于微信开放平台来说的,

和小程序关联公众号或者公众号关联小程序没什么关系.

你把小程序绑定到微信开放平台上去,

通过wx.getUserInfo得到的信息就能把UnionID直接查出来.

如果有公众号同时绑定到微信开发平台的话,

公众号通过以snsapi_userinfo为scope发起的网页授权,也能拿到UnionID,

关于公众号和小程序如何联动拿到UnionID,

可参考

https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html


拾忆:

必须绑定到同一个开放平台下,而不是关联到公众号。

微喵网络:他上个问题你就这么回,他看不懂才又发的新问题,你觉得你同样的回答,他就能看懂了?
拾忆:看不懂再回一次

-EOF-

AI助手支持GPT4.0