2015-09-19 92 views
-1

我想從包含與帖子相關的所有圖片的頁面獲取帖子。 我能夠使用object_id從帖子中獲得一張圖片,但我也需要其他照片。從頁面的帖子(Facebook GraphAPI - Android)獲取多張圖片ID

object_id只返回一個ID,它是第一張照片的ID。

請幫忙。

GraphRequest greq = 
        new GraphRequest(
          AccessToken.getCurrentAccessToken(), 
          "/{page-id}/posts", 
          null, 
          HttpMethod.GET, 
          new GraphRequest.Callback() { 
           public void onCompleted(GraphResponse response) { 
            JSONArray data = null; 

           } 
          } 
        ); 
      Bundle params = new Bundle(); 
      params.putBoolean("redirect",false); 
      params.putString("fields", "object_id"); 
      greq.setParameters(params); 
      greq.executeAsync(); 

回答

0

該數據應該在attachments字段中。具體在subattachments子字段中。

您應該在Graph API資源管理器中對此進行測試,以查看API響應並基於此更新您的Android實施。

+0

非常感謝你,工作就像一個魅力! – narengoku

相關問題