Facebook 检查用户是否“喜欢"这一页 [英] Facebook Check if user "Liked" the page

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

问题描述

我为一家公司制作了几个 Facebook FBML Canvas 页面(Facebook 认为这些是应用程序),他们要求喜欢"该页面的用户将被重定向到另一个页面,或者页面将使用 AJAX 显示不同的内容.

I made a few Facebook FBML Canvas pages (Facebook considers these to be Applications) for a company, and they requested that users who "Like" the page would be redirected to another page, or the page will display different content with AJAX.

我浏览了 Facebook 开发者文档,但找不到如何操作的线索.

I went through the Facebook Developers Documentation, but I can't find a clue on how to do it.

我确定有人以前做过,有什么建议吗?

I'm sure someone has done it before, any suggestions?

推荐答案

如果你正在处理facebook app标签页,下面的代码可以帮助你找到isfan状态

If you are dealing with facebook app tab page, the following code helps you to find isfan status

$signed = parse_signed_request($_REQUEST['signed_request'], 'YOUR-APP-SECRET');
if ($signed['page']['liked'] == 1) {
    $fan = true;
} else {
    $fan = false;
}

访问此链接以获取演示和源代码代码.

Visit this link for demo and source code.

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

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