Unable to post Open Graph actions as a Test User

喜夏-厌秋 提交于 2019-12-10 06:20:14

问题


I've been able to post Open Graph actions using my own account, but I'm unable to do the same as a Test User of the application, receiving this error:

OAuthException: An unexpected error has occurred. Please retry your request later.

I've tested the access token that I'm using with the debugger and it's fine.

Here's the code I'm using - I'm pretty sure the code is fine, because it works when I'm logged in as myself:

$token = $this->facebook->getAccessToken();
$params = array(
    'access_token' => $token,
    '{object}' => 'http://samples.ogp.me/{objectID}',
);

try
{
    $result = $this->facebook->api('/me/{namespace}:{action}', 'POST', $params);
    echo $result;
}
catch(FacebookApiException $e)
{
    echo $e;
}

This question: Unable to use Test Users for posting through Open Graph seems to have a similar problem, but the fix posted doesn't work for me (I've tried creating test users through the Roles section, and via the graph API).

Has anyone been able to post actions when logged in as a test user?


回答1:


The problem I was having was caused by setting 'Sandbox Mode' to 'enabled' in App Settings > Advanced.

The following page suggests enabling Sandbox Mode when testing the app, but Test Users can't publish Open Graph actions in Sandbox Mode.

http://developers.facebook.com/docs/ApplicationSecurity/



来源:https://stackoverflow.com/questions/8898851/unable-to-post-open-graph-actions-as-a-test-user

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