问题
I'm implementing Facebook login with an extended permission publish_actions using PHP SDK. It shows a message in the login dialog even if I signed in with my primary administrator account:
Submit for Login Review. Some of the permissions below have not been approved for use by Facebook
I have the following code snippet to post to the user timeline.
try {
$response = (new FacebookRequest(
$session, 'POST', '/me/feed', array(
'message' => 'This is test post.'
)
))->execute()->getGraphObject();
echo "Posted with id: " . $response->getProperty('id');
} catch(FacebookRequestException $e) {
echo "Exception occured, code: " . $e->getCode();
echo " with message: " . $e->getMessage();
}
When I executed the code, I got the error
Exception occured, code: 200 with message: (#200) The user hasn't authorized the application to perform this action
According to the Facebook login review documentation, it is not required to submit a login review for the app's developer accounts.
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_actionsormanage_pages).
I added another administrator account and a developer account into the app Roles tab setting and let them try, but still encountering the same problem.
My app status is live. I'm testing it from the local site with virtual host such as mysite.local, but it shouldn't be a problem since I could add it in the app setting.
来源:https://stackoverflow.com/questions/29700838/cant-request-facebook-login-api-permission-publish-actions-even-for-primary-a