Post a picture to the wall from android

前端 未结 1 1787
渐次进展
渐次进展 2021-01-14 08:11

I want to post a picture to the wall, just like what I can do from the facebook web page.

I\'ve tried these two ways, but both not what I want.

  1. [ http:
相关标签:
1条回答
  • 2021-01-14 08:48

    The accepted answer in the 1st thread is correct, with just one change, you see when you upload a picture in facebook, like in the screen capture you added, you post it to a specific album titled "Wall Photos".

    In that answer they used me/photos, and that will create an album for the app (if one isn't already existing) and post the image there.

    I think that this should work:

    Bundle params = new Bundle();
    params.putByteArray("source", imageBytes);
    params.putString("message", "A wall picture");
    facebook.request("me/feed", params, "POST");
    

    (you can obviously use the async runner)

    If that does not work, then you'll have to get the "wall photos" album id of the logged in user first and then do something like:

    Bundle params = new Bundle();
    params.putByteArray("source", imageBytes);
    params.putString("message", "A wall picture");
    facebook.request("ALBUM_ID/photos", params, "POST");
    
    0 讨论(0)
提交回复
热议问题