0

我想实现我的应用程序auto_publish。点击登录按钮时,请求'publish_stream'权限。自动发布图形API在用户的Facebook墙上

我似乎可以得到它的用户的自动墙成功登录后发布。这里是我的代码:

  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!'); 

      }); 
     } 
+0

您是否在回调中尝试过'console.log(response)'? – 2011-12-28 10:26:43

+0

@AhmedNuaman添加的console.log(响应),但仍无济于事:( – doodoodukes 2011-12-28 10:35:26

+0

是什么回来?它应该给你一个状态消息,作为对正在发生的事情。 – 2011-12-28 11:07:34

回答

0

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'}); 
+0

我在我的代码中已经有了这个块,我只是没有显示它。请注意,登录时我有'publish_stream'权限请求。 – doodoodukes 2011-12-28 09:24:16

相关问题