本文介绍了无法以测试用户身份发布Open Graph操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经可以使用自己的帐户发布Open Graph操作,但是我无法执行与应用程序的测试用户相同的操作,收到此错误:

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:

我已经测试了调试器使用的访问令牌,这很好.

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;
}

这个问题:无法使用测试用户通过Open Graph发布似乎也有类似的问题,但是该修复程序对我不起作用(我已经尝试通过角色"部分和图形API创建测试用户).

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?

推荐答案

我遇到的问题是由于在应用程序设置">高级"中将沙盒模式"设置为启用"引起的.

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/

这篇关于无法以测试用户身份发布Open Graph操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 00:42