我想從JavaScript發佈到Facebook頁面源(就好像它是從頁面發佈的)。我登錄OK,但是當我嘗試後,它給出了錯誤Facebook圖形API - (#200)頁面上的權限錯誤發佈
"error: Object code: 200 message: "(#200) Permissions error" type: "OAuthException"
在登錄中,auth響應來通過與下面的權限,我相信有足夠 -
"email,contact_email,manage_pages,publish_pages,publish_actions,public_profile"."
如何我可以得到這個工作嗎?
主要部件(plunk):
function postToMembers(){
var access_token1 = FB.getAuthResponse()['accessToken'];
var body = 'Post from code test';
FB.api('/41622-PAGEID-34/feed', 'post', { message: body, access_token: access_token1 }, function(response) {
if (!response || response.error) {
console.log(response);
} else {
alert('Post ID: ' + response.id);
}
});
};
function loginAndPost(){
FB.login(function(response) {
if (response.authResponse) {
//Log auth permissions (in the response)
console.log(response);
FB.api('/me', function(response) {
console.log('Successful login for: ' + response.name);
document.getElementById('status').innerHTML =
'Thanks for logging in, ' + response.name + '!';
});
postToMembers();
} else {
console.log('User cancelled login or did not fully authorize.');
}
}, {scope: 'publish_actions,publish_pages,manage_pages', return_scopes: true});
};
有關的信息,我已經看了看文檔here,here和here許多StackOverflow的職位,但不能讓它去。