无法以测试用户身份发布开放图操作

发布于 2024-12-27 06:47:58 字数 744 浏览 2 评论 0原文

我已经能够使用自己的帐户发布开放图操作,但我无法作为应用程序的测试用户执行相同的操作,收到此错误:

OAuthException:发生意外错误。请重试您的 稍后请求。

我已经测试了与调试器一起使用的访问令牌,效果很好。

这是我正在使用的代码 - 我很确定代码没问题,因为当我以自己的身份登录时它可以工作:

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

这个问题: 无法使用测试用户通过开放图谱发布似乎有类似的问题,但发布的修复对我不起作用(我尝试通过角色部分创建测试用户,并且通过图表应用程序编程接口)。

有没有人能够在以测试用户身份登录时发布操作?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光瘦了 2025-01-03 06:47:58

我遇到的问题是由于在“应用程序设置”>“沙盒模式”中将“沙盒模式”设置为“启用”引起的。先进的。

以下页面建议在测试应用程序时启用沙盒模式,但测试用户无法在沙盒模式下发布开放图操作。

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

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文