我想發佈到用戶爲admin的Facebook頁面。這裏是代碼我有使用JavaScript SDK發佈到Facebook頁面時的授權問題
FB.init({appId: "***********", status: true, cookie: true, frictionlessRequests: true});
var page = null;
function postToPage(page, msg){
FB.api('/'+page.id+'/feed', 'post', { message: msg, access_token: page.access_token },
function(res) { console.log(res) }
)
}
FB.login(function(response) {
if (response.authResponse) {
// user is logged in and granted some permissions.
FB.api('/me/accounts', function(response) {
console.log(response);
page = response.data[0];
postToPage(page, 'hello fb-page world');
})
} else {
// User cancelled login or did not fully authorize.
}
}, {scope:'read_stream,publish_stream,offline_access, manage_pages,status_update'});
它不工作,當我看到控制檯上,我有錯誤:
(#200) The user hasn't authorized the application to perform this action
我缺少的scope
的授權?