Facebook 粉丝页面应用程序上的用户数据
我创建了一个应用程序并将其连接到一个粉丝页面,以便在该页面中加载应用程序内容。
访问user_id和用户名只有在用户授权该应用程序的情况下才能访问。
如何在用户喜欢该页面的同时对应用程序进行授权?
我的意思是,当用户单击喜欢页面按钮时,还应该出现应用程序授权对话框。或者如果我错了请建议正确的方法。
--- 编辑 ----
我正在使用 php-sdk v3.1.1。
I have created a application and connected it to a fan page so that application content is loaded in that page.
To access user_id and name of user can only be accessed if user have authorized the application.
How application can be authorized at the same time as user have liked the page?
I mean that when user clicks on like page button application authorization dialog box should also appear. Or if i am wrong please suggest the right way.
--- EDIT ----
I am using php-sdk v3.1.1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是不可能的,类似页面的按钮没有以任何方式连接到您的应用程序。
您可以做的是解析传递给您的应用程序的signed_request参数,以检查用户是否喜欢该页面,如果喜欢,您可以检查是否可以获得用户对象,并在需要时将其重定向到授权。
如果您不需要用户 ID 或任何其他扩展功能(例如发布到墙上),而只想检查用户是否喜欢该页面,您可以只使用签名的请求,而无需考虑其余的授权。
您可以使用应用程序密钥和以下函数解码signed_request:
为了确定类似的情况,您需要执行以下操作:
This isn't possible, the page like button is not connected in any way to your application.
What you can do is parse the signed_request parameter which is passed to your application to check if the user has liked the page, if he did you can then check if you can get the user object and redirect him to authorization if needed.
If you don't need the user id or any other extended features (such as posting to the wall) and just want to check if a user has liked the page you can just use the signed request and forget about the rest of the authorization.
You can decode the signed_request using your application secret key and the following function:
In order to determine the like you need to do the following: