douxu0550 2010-09-09 08:26
浏览 47

Facebook API - 如何检查粉丝的应用程序?

I try to create an facebook application. I created a new application 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?

  • 写回答

1条回答 默认 最新

  • dorpbn1027 2010-09-09 15:15
    关注

    Try to pass user_id as a second parameter.

    评论

报告相同问题?