开发者

Facebook API - How to check in application for fans?

I try to create an facebook application. I created a new applicati开发者_如何学JAVAon and downloaded the framework. In my index.php i do the following:

<?php
require_once 'facebook.php';

$appapikey = '123456...xyz';
$appsecret = '123456...xyz';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
$pageid = "123456...xyz";
$isfan = $facebook->api_client->pages_isFan($pageid);

if($isfan)
        echo '<iframe src="http://www.google.com/" width="720" height="1250" frameborder="0"></iframe>';
else
        echo 'you have to become a fan!';

Without $isfan, it shows me the correct output. But with this question, I always see the else statement (also when I am a fan).

Any ideas?

Maybe my $pageid is not correct. I showed on my page (e.g. http://www.facebook.com/pages/Microsoft/107785359249238?ref=ts ) and used 107785359249238 as pageid. Is that right?


Try to pass user_id as a second parameter.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜