0

I am trying to retrieve the facebook's latest post in my android app by using the code given below. But it gives me only my shares and comments. I want to get these as well as my messages which I post on my status, but it always comes as null.

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");
}

Here, if I post some text on my status then also 'msg' is null.

Please provide your suggestions. Thanks.

4

1 に答える 1

0

非公開の投稿にアクセスするには、アプリに「read_stream」権限が必要です。他のメソッドに必要なその他のアクセス許可については、ユーザー API リファレンスの接続セクションを参照してください。

Graph API Explorerを使用して、最初にリクエストを試すことができます。

于 2013-01-23T17:31:30.633 に答える