如何获取公众号的unionId和小程序的unionId?

小程序 文章 2020-08-08 12:01 658 0 全屏看文

AI助手支持GPT4.0

如何获取公众号的unionId和小程序的unionId?How to get the unionId of the official account and the unionId of the mini program?

如何获取公众号的unionId和小程序的unionId?

1.先申请了服务号,然后在服务号里面建了个小程序,发现在用的时候,没有unionId。

2.秉着遇事有问题就重启的原则,我重启试了n遍,还是不行,请问是我的错吗?

1. First apply for the service number, and then create a small program in the service number. It is found that there is no unionid when using it. 2. According to the principle of restarting when there is a problem, I have tried to restart it n times, but it still can't. is it my fault?

回答:

拾忆:

需要绑定在开放平台下才可以,而且unionid是开放平台的唯一标识并不是小程序和公众号的。

宋佳耀:

1、注册个微信开放平台账号https://open.weixin.qq.com/ 并且把你的公众号和小程序都绑定进去

2、注意unionid的下发触发机制,只有用户进入你第二个同主体的应用时,才会带上unionid。简单来说在你绑定好开放平台以后,用户先关注公众号是没有unionid的,当他再进入小程序时,才会带着unionid。

青寒:

1,你需要去申请微信开发平台账号。https://open.weixin.qq.com/

2,在开放平台,把微信服务号、小程序都加进去

这样才能有unionid

-EOF-

AI助手支持GPT4.0