0

I want to post a message on my wall, adding a PNG image (not a URL), as shown below. Everything works except that no image is posted. Is this even supported? Is there a size limit?

Bundle params = new Bundle();
params.putString("access_token", session.getAccessToken());
params.putString("description", message);
params.putString("caption", caption);
params.putString("name", name);
params.putString("link", link);

// Does not work:
// params.putByteArray("photo", pngByteArray);
// params.putByteArray("picture", pngByteArray);

WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(this,
   Session.getActiveSession(),
   params)) /* ... */

As you can see, I'm using the FeedDialogBuilder class to let the user confirm the wall post.

4

2 回答 2

0

This code is working for me:

Bundle params = new Bundle();
params.putString("access_token", session.getAccessToken());
params.putString("description", message);
params.putString("caption", caption);
params.putString("name", name);
bundle.putByteArray("picture", byte);
String response = facebook.request("me/photos",bundle,"POST");

hope it will help you.

于 2013-01-02T19:05:12.977 回答
0

You need one more field in it,

params.putString("app_id", "Your_App_ID_Required");

it worked for me after I added this field..

于 2013-08-16T03:56:52.623 回答