简体   繁体   English

Facebook Javascript SDK:在发布到Feed时验证访问令牌时出错

[英]Facebook Javascript SDK: Error validating access token when posting to feed

I'm trying to implement posting to a user's feed from my website. 我正在尝试从我的网站实施发布到用户的供稿。 I am using the Javascript SDK and have managed to get myself logged in, and granted both publish_stream and publish_actions permissions. 我正在使用Javascript SDK,并设法使自己登录,并同时授予了publish_stream和publish_actions权限。 However when I call the /me/feed post action, I get the following error as the response: 但是,当我调用/ me / feed post操作时,得到以下错误作为响应:

code: 190
error_subcode: 467
message: "Error validating access token: This may be because the user logged out or may be due to a system error."

I am using the client-side authentication model from here: 我从这里使用客户端身份验证模型:

https://developers.facebook.com/docs/authentication/client-side/ https://developers.facebook.com/docs/authentication/client-side/

This is the FB.api feed post code I'm using: 这是我正在使用的FB.api提要邮政编码:

FB.api('/me/feed', 'post', { message: 'Testing FB feed posting' }, function(response) {
if (!response || response.error) {
    alert('Error');
        console.log(response);
    }
    else {
        alert('Posted');
    }
});

I've checked the application settings and the domain is set right. 我已经检查了应用程序设置,域设置正确。 I've also double checked that I have permissions to do this post. 我还仔细检查了我是否有权执行此信息。 Can anyone see where I'm going wrong please? 谁能看到我要去的地方吗?

Any help would be much appreciated. 任何帮助将非常感激。

尝试检查FB.getLoginStatus(function(response){//在这里做代码});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM