一个公众号下的网页,实现只有用户关注公众号才能访问,怎么做呀

WBOY
Release: 2016-06-06 20:36:16
Original
2014 people have browsed it

要做一个抽奖页面,用户分享到朋友圈后,别人是直接通过点击连接进来的,怎么实现这个人要是没关注提示他先关注呢,或者直接跳转到关注的页面?

回复内容:

要做一个抽奖页面,用户分享到朋友圈后,别人是直接通过点击连接进来的,怎么实现这个人要是没关注提示他先关注呢,或者直接跳转到关注的页面?

你可以使用公众号开发里面的网页授权接口得到用户access_token、openid,然后再调用获取用户信息的接口来判断是否已关注。

你需要一个具有 “网页授权” 的服务号(公众号不行),认且必需认证,通过 OAuth2 授权之后可以拿到用户的全部信息!

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!