微信订阅号获取openid

WBOY
Release: 2016-06-20 12:39:54
Original
2171 people have browsed it


网上都说订阅号不能获取用户信息,那我现在不要用户信息,只想获取一个能标识一下用户的openid也不行么?
不知道有没有对微信开发很熟悉的大神啊,能不能教教我怎么在订阅号上获取openid啊,查过资料,说用微信给的测试连接代码,在验证过后把$wechatObj->valid();注释,改成$wechatObj->responseMsg();
可这样也是在公众号里关注以后还是没有回复消息,没有任何响应,也不报错,微信官方给的API也没有说明,真心纠结了。。


回复讨论(解决方案)

你关注后随便发发文字试试

另外openid是可以获得的,但这得分网页端和微信端两种API

你所使用的测试代码里有一行 $fromUsername = $postObj->FromUserName;
这个$fromUsername就是你拿到的openid

openid 不是用户基本信息

解决了,把腾讯官方给的代码,注释掉一句安全验证xml的方法就能用了。。。。。。。

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
Popular Tutorials
More>
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!