2016-09-25 29 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/ –

相关问题