Can't request Facebook Login API permission “publish_actions” even for primary administrator

限于喜欢 提交于 2020-01-17 05:12:33

问题


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_actions or manage_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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!