Get all Facebook feeds from my wall and using POST method using FBConnect

对着背影说爱祢 提交于 2019-12-11 06:25:00

问题


I'm trying to implement Facebook features in android Application. I'm using FBConnect.jar i have two questions

  1. I can post something to wall using following code

        String response = mFacebook.request("me");
        Bundle parameters = new Bundle();
        parameters.putString("message", msg);
        parameters.putString("description", "test test test");
        response = mFacebook.request("me/feed", parameters, "GET");
    

    Here i have used GET method. Is it possible to use POST method if so what is the syntax

  2. Then if i want to get news feeds of my account i use following code

            JSONObject response = Util.parseJson(mFacebook.request("me/feed"));
            JSONArray jArray = response.getJSONArray("data");
            for(int i=0;i<jArray.length();i++){
                json_data = jArray.getJSONObject(i);
                if(json_data.has("message") && (json_data.has("name"))){
                    String name = json_data.getString("name");
                    String message=json_data.getString("message");
                    Log.i("GET ACTIVITY",String.format("Name is %s and Message is %", name,message));
                }
            }
    

Here i can get feeds that are posted by me in my account. But if i want all Facebook feeds that are in my wall (Friends and me). pls give me some sample code too.

Thanks, Shanmugam.


回答1:


Try me/home instead of me/feed



来源:https://stackoverflow.com/questions/7291127/get-all-facebook-feeds-from-my-wall-and-using-post-method-using-fbconnect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!