2016-09-25 67 views
-1

我正在將Facebook SDK集成到我的Android應用程序。我遵循指導:https://developers.facebook.com/docs/graph-api/reference/v2.7/post。我試圖通過方法來獲取細節後在公開組:Facebook Android SDK - 獲取公開信息不會顯示完整字段

final String POST_ID = "1446400445645839_1796360410649839"; 
new GraphRequest(
     AccessToken.getCurrentAccessToken(), 
     "/" + POST_ID, 
     null, 
     HttpMethod.GET, 
     new GraphRequest.Callback() { 
      public void onCompleted(GraphResponse response) { 
       /* handle the result */ 
       Log.d("DEBUG","post detail ---------------------"); 
       Log.d("DEBUG",response.toString()); 
       Log.d("DEBUG","post detail--------------------------"); 
      } 
     } 
).executeAsync(); 

而且我得到的迴應:

{Response: responseCode: 200, graphObject: {"created_time":"2016-09-25T02:57:29+0000","message":"Because of its_________for outstanding customer service, Mei’s Hair Salon is the most popular business of its kind in the area. \nA. approval\nB. estimation\nC. probability\nD. reputation\nCâu này trong ETS 2016. đáp án theo sách mình down là D. Bạn nào giải thích giúp mình giữa C và D được không ạ?","id":"1446400445645839_1796360410649839"}, error: null}

退房Facebook的領域見下表: enter image description here

看來,一些領域是錯過的,如名稱,標題,從... 你能解釋並給我建議,以獲得像名稱,標題字段?

更新: 我發現這篇文章的解決方案在:Android Facebook - How to get like count for a post?

回答

0

https://developers.facebook.com/docs/graph-api/using-graph-api

By default, not all fields in a node or edge are returned when you make a query. You can choose the fields or edges that you want returned with the fields query parameter. This is really useful for making your API calls more efficient and fast.

For example, the following Graph API call https://graph.facebook.com/bgolub?fields=id,name,picture will only return the id, name, and picture in Ben's profile:

+0

謝謝。我試過了 。但我得到了同樣的迴應。你有什麼建議嗎? final String POST_ID =「1446400445645839_1796360410649839」; GraphRequest請求=新GraphRequest(... ); Bundle parameters = new Bundle(); parameters.putString(「fields」,「id,name,link」); request.setParameters(parameters); request.executeAsync(); } –

+0

我跟着https://developers.facebook.com/docs/android/graph/ –