开发者

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

开发者 https://www.devze.com 2023-04-01 22:50 出处:网络
I\'m trying to implement Facebook features in android Application. I\'m using FBConnect.jar i have two questions

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") &开发者_StackOverflow& (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.


Try me/home instead of me/feed

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号