开发者

How to Facebook Post to friends in Android?

开发者 https://www.devze.com 2023-02-15 10:07 出处:网络
I am new to Android. I would like to post an image to my friend\'s Wall using Facebook. I have downloaded code from GitHub sour开发者_开发技巧ce. I logged in my account, say peter@gmail.com and grab

I am new to Android. I would like to post an image to my friend's Wall using Facebook.

I have downloaded code from GitHub sour开发者_开发技巧ce. I logged in my account, say peter@gmail.com and grab all of my friends list and populate all my friends in List View.

I have IDs and names of all friends.


Try this :

try{
    Bundle parameters = new Bundle();
    JSONObject attachment = new JSONObject();

    try {
        attachment.put("message", "Messages");
        attachment.put("name", "Get utellit to send messages like this!");
        attachment.put("href", link);
    } catch (JSONException e) {
    }
    parameters.putString("attachment", attachment.toString());
    parameters.putString("message", "Text is lame. Listen up:");
    parameters.putString("target_id", "XXXXX"); // target Id in which you need to Post 
    parameters.putString("method", "stream.publish");
    String  response = authenticatedFacebook.request(parameters);       
    Log.v("response", response);
}
catch(Exception e){}

Also check this for Reference Post on Friends Wall

0

精彩评论

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