我开发了 Facebook 应用程序,我在“允许访问步骤”上遇到了一些问题,在初始阶段用户必须授权应用程序和权限。目前如果用户跳过扩展权限也登陆到应用程序主页,但我需要强制用户接受所有权限,我在使用 FQL 方法时成功了,现在它不起作用,我找不到解决方案。这是我的代码
$TotalPermissions = UserAndFriendsPermissions();
return true;
$tp = substr_replace($TotalPermissions ,"",-1);
$this->loadClassFile("Facebook", MAIN_PLUGIN_PATH."Common/facebook/facebook.php");
$facebook = new Facebook(array('appId' => $FBConnect["fb_app_id"],'secret' => $FBConnect["fb_secret_key"],));
$params = array('method' => 'fql.query','query' => "SELECT ".$tp." FROM permissions WHERE uid=me()");
$result = $facebook->api($params);
$totalp = count(explode(",",$tp));
$ap=0;
foreach ($result[0] as $key => $val)
{
if($val==1)
{
$ap++;
}
}
if($ap==$totalp)
{
return true;
}
else
{
?>
<?php
Redirect("https://apps.facebook.com/APP_NAMESPACE");
}