我正在尝试通过测试应用向我自己的供稿做一个简单的帖子。我断断续续地收到了提示,但是权限不固定,如果无法测试,我没有应用程序可供查看。我的应用程序处于开发模式,我已将重定向URL添加到域,并按照我在Facebook Developer网站上可以找到的尽可能多的说明进行操作。
window.fbAsyncInit = function() {
FB.init({
appId: "xxxx",
autoLogAppEvents: true,
xfbml: true,
version: "v3.2"
});
init();
};
(function(d, s, id) {
var js,
fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
return;
}
js = d.createElement(s);
js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
})(document, "script", "facebook-jssdk");
function init() {
FB.login(
function(response) {
if (response.authResponse) {
console.log("Welcome! Fetching your information.... ");
// Throws #200 error
FB.api(
"/me/feed",
"post",
{
message: "Das Post",
access_token: response.authResponse.accessToken
},
function(response) {
console.log("Good to see you, " + response.name + ".");
}
);
// Succeeds
FB.api("/me/accounts", function(response) {
console.log(response);
});
} else {
console.log("User cancelled login or did not fully authorize.");
}
},
{
scope: "manage_pages,publish_pages"
}
); // Does not appear to work properly
}
上面的代码登录后返回,并显示以下错误:
(#200)需要publish_to_groups权限,且应用必须 安装在组中,或以admin的身份管理manage_pages和publish_pages 足够的管理权限