-2

我开发了 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");
                    }
4

1 回答 1

0

You cannot force users to accept all your extended permissions. What you can do is to check for permissions given and handle those cases accordingly i.e. redirecting users who have not given permission to a landing page which explains why you need those permissions.

于 2012-08-14T10:43:06.663 回答