Reputation: 91
I have a very simple PHP app that retrieves a users & friends RSVPd events using FQL. It is using the latest PHP SKD. The code works perfectly when I am logged in and authenticated as the account that created the app, but it fails with 'unknown error' if I am logged in and authenticated as anyone else.
Here is the login portion of my code
$config = array();
$config['appId'] = $validId;
$config['secret'] = $validSecret;
$facebook = new Facebook($config);
$uid = $facebook->getUser();
// get the url where to redirect the user
$location = "". $facebook->getLoginUrl(array('scope' => 'user_events, friends_events'));
// check if we have valid user
if ($uid) {
try {
$fb_user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
$fb_user_id = NULL;
// seems we don't have enough permissions
print '<script language="javascript" type="text/javascript"> top.location.href="'. $location .'"; </script>';
// kill the code so nothing else will happen before user gives us permissions
die();
}
} else {
// seems our user hasn't logged in
print '<script language="javascript" type="text/javascript"> top.location.href="'. $location .'"; </script>';
// kill the code so nothing else will happen before user gives us permissions
die();
}
print "Authenticated ". $fb_user_profile['name']." <a href='logout.php'>Logout</a><br>";
Here is the FQL portion of my code
$param = array(
'method' => 'fql.query',
'query' => $validFqlQuery,
'callback' => '',
'access_token' => $facebook->getAccessToken()
);
echo "<br>Working...";
$fqlResult = $facebook->api($param);
print_r($fqlResult);
Upvotes: 1
Views: 115
Reputation: 2670
Your App needs to be reviewed by Facebook before it goes Live for other users to Login.
You do not need to go through Login Review
if your app requests these three basic permissions:
To ask your app's users for any other permissions, you will need to submit for review.
However, in order to help you craft your Facebook Login experience, your app's developers will be able to see, and grant, any permission without requiring review by Facebook.
Note: People who are listed in your app's Roles tab will have access to extended permissions without going through review (e.g. publish_actions or manage_pages). For example, if you use the Facebook Plugin for Wordpress to publish your blog posts to your Facebook Page or Profile, you do not need to submit for review so long as all your publishers are listed in your app's Roles tab.
Upvotes: 1