2016-03-26 36 views
-2

我正在使用圖形API獲取由使用FB.login API進行身份驗證的用戶創建的事件列表。如何使用JS sdk獲取用戶在facebook中創建的事件列表?

我有一個好友API似乎爲我工作,但得到的事件不起作用。

 //function that gets the list of friends 
     function getFriends() { 
      FB.api('/me/friends', function(response) { 
       //console.log(response); 
      }); 
     } 

     //function that gets the list of events for the user. 
     function getEvents() { 
      FB.api('/me/events',function(data) { 
       if (data && !data.error) { 
        console.log(data); 
       } 
      }); 
     } 

回答

0

您的用戶訪問令牌需要user_events權限。

+0

對不起,我應該更新它我登錄的權限 –

+0

我改變了句子以提供答案... – Norbert

相關問題