0
我想通過使用下面給出的代碼檢索我的Android應用程序中的Facebook的最新帖子。但它只給我我的份額和評論。我想得到這些以及我發佈的關於我的狀態的消息,但它總是爲空。Facebook帖子在Android中檢索
Bundle params = new Bundle();
params.putString("format", "json");
params.putString("access_token",sp.getString("access_token",null));
String url = "https://graph.facebook.com/me/feed";
String response = Util.openUrl(url, "GET", params);
JSONObject json = Util.parseJson(response);
JSONArray jsonArray = json.optJSONArray("data");
if(jsonArray != null) {
i=0;
String tempName = jsonArray.getJSONObject(i).getString("from");
String tempId = jsonArray.getJSONObject(i).getString("id");
String story = jsonArray.getJSONObject(i).getString("story");
String msg = jsonArray.getJSONObject(i).getString("message");
}
在這裏,如果我發佈了一些關於我的狀態的文本,那麼'msg'也是null。
請提供您的建議。謝謝。
它擁有所有的堅持,但我會閱讀實時數據? – abhinav
我不確定你的意思。一旦我授予我的應用程序read_stream權限,每當我提出/ me/feed請求時,就可以看到我製作的最新帖子。 –
我可以獲取除消息字段以外的所有內容 – abhinav