[英]Posting to an unauthenticated user's wall using the facebook graph api
[英]Auto publish graph API on user's Facebook wall
我正在嘗試在我的應用程序中實現auto_publish。 單擊登錄按鈕后,需要“ publish_stream”權限。
成功登錄后,我似乎可以將其自動發布在用戶牆上。 這是我的代碼:
function graphStreamPublish(){
showLoader(true);
FB.api('/me/feed', 'post', publish,
{
message : "Merry Christmas!",
link : 'http://domain.com',
picture : 'http://domain.com/xxxx.jpg',
name : 'Happy Christmas',
description : 'Send a Christmas greeting!'
},
function(response) {
console.log(response);
alert('Shared!');
});
}
您的FB.login在哪里?
FB.login(function(response) {
if (response.authResponse) {
FB.api('/me', function(response) {
//YOU CAN PUT YOUR POSTING CODE HERE
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
}, {scope: 'email'});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.