Advanced Facebook API Permissions in PHP

I am trying to write an application using the latest PHP PHP SDK. However, any extended permissions that I request are simply not requested, it always by default requests the main request and does not request any requested extended permissions.

Here is how I request these permissions:

<?php 
require_once("facebook.php");

$app_id = "xxx";
$app_secret = "xxx";

$facebook = new Facebook(array(
    'appId' => $app_id,
    'secret' => $app_secret,
    'cookie' => true
));

if(is_null($facebook->getUser())){
    $params = array(‘scope’ => ‘user_status,publish_stream,user_photos’);       
    header("Location:{$facebook->getLoginUrl($params)}");
    exit;
}
?>

This file is included at the beginning of any page on which my application is embedded. Any ideas as to why I am not getting the extended permissions that I want?

+5
source share
2 answers

, '. , - .

if(is_null($facebook->getUser())){
    $params = array('req_perms' => 'user_status,publish_stream,user_photos');
    header("Location:{$facebook->getLoginUrl($params)}");
    exit;
}

UPDATE: scope req_perms SDK.

+6

"scope" .

0

All Articles