perl Facebook::Graph API 检查用户是否喜欢页面 [英] perl Facebook::Graph API check if user likes page

查看:30
本文介绍了perl Facebook::Graph API 检查用户是否喜欢页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Facebook::Graph 并且每次加载页面时,我都会想检测服务器端用户是否喜欢某个页面.我在文档中找不到如何做到这一点.是否可以在不将用户 ID 发送到我的服务器端脚本的情况下执行此操作?因为我知道使用 javascript SDK 你可以检查这个,但我觉得它可能与服务器端 API 不同.

I'm using Facebook::Graph and any time a page is loaded, I would like to detect server-side if a user has liked a certain page or not. I can't find in the documentation how to do this though. Is it possible to do this without sending the user ID to my server-side script? Because I know using the javascript SDK you can check this, but I feel like it might be different with a server-side API.

推荐答案

不确定任何时候加载页面"是什么意思...我猜你是说应用程序的页面?如果是这样,您需要 user_likes 权限才能获取有关用户喜欢的信息.

Not sure what you mean with "anytime a page is loaded"... I guess you mean an page of an App? If so, you need the user_likes permission to be able to get the information on the User's likes.

如果您使用的是主页选项卡应用程序,那么您可以从 signed_request 中获取此信息,一旦用户从 Facebook 主页选项卡访问该应用程序,该信息就会传递给该应用程序.请参阅 https://developers.facebook.com/docs/reference/login/signed-request/ 指示器位于 page.liked 字段中.

If you're using a Page Tab App, then you could get this info out of the signed_request which is passed to the App once the User accesses it from the Facebook Page Tab. See https://developers.facebook.com/docs/reference/login/signed-request/ The indicator is in the page.liked field.

这篇关于perl Facebook::Graph API 检查用户是否喜欢页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆