开发者

Facebook post on Friends wall in Android

开发者 https://www.devze.com 2023-02-16 14:39 出处:网络
I would like to post a picture to my friend\'s wall. But I logged in to my account say test@gmail.com, but now I want to post on to any of my friend wall.

I would like to post a picture to my friend's wall.

But I logged in to my account say test@gmail.com, but now I want to post on to any of my friend wall.

I am having all my friends id and Name.

Is it possible to Post a picture in friends wall by lo开发者_运维百科gged to my account? If so how is it possible?


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){}


The Facebook SDK in general, as well as the one for Android, allows you to do so. See the example code here.

0

精彩评论

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