2016-03-03 18 views
-1
new GraphRequest(
      AccessToken.getCurrentAccessToken(), 
      "/"+MainActivity.ME_FBUSER_ID+"/events", 
      null, 
      HttpMethod.GET, 
      new GraphRequest.Callback() { 
       public void onCompleted(GraphResponse response) { 
      /* handle the result */ 
        Log.e("event",response.toString()); 
        Toast.makeText(getActivity(), ""+response.toString(), Toast.LENGTH_SHORT).show(); 
       } 
      } 
).executeAsync(); 

回報獲取Facebook的用戶活動列表和細節的Android

{Response: responseCode: 200, graphObject: {"data":[]}, error: null} 
+0

有什麼實際問題? – Tobi

回答

1

你有沒有設置權限?那對於你必須設置user_events權限。在用戶登錄時。像下面

LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton); 
authButton.setFragment(this); 
authButton.setReadPermissions(Arrays.asList("user_events", "friends_events")); 

見下面鏈接,用戶權限:

https://developers.facebook.com/docs/facebook-login/android/permissions

https://developers.facebook.com/docs/facebook-login/permissions/#adding

您必須添加權限後,你可以得到它。

如果你已經完成了所有上述的事情,而不是工作,那麼你必須把應用程序審查。

如果您在Graph API Explorer中看到調試消息就像吹出圖像一樣。你必須把應用程序審查。

enter image description here

Documantation說To use the user_events permission you need to submit your app for review.

見下圖: enter image description here

相關問題