0

Is it possible to checkin with a picture on the device?

I tried using "picture" bundle, but it only works if I point to a URL, not working if I use a byte array. The picture is just not shown on the wall if I use byte array.

Working: bundle.putString("picture", "http://www.somewhere.com/picture.jpg");

Not working: bundle.putByteArray("picture", imageByteArray[]);

Bundle bundle = new Bundle();
bundle.putByteArray("picture", imageByteArray[]);  // load from device
bundle.putString("message", "The offee is just meh.");
bundle.putString("place", "my place id");
bundle.putString("coordinates", "my coordinates");
bundle.putString("access_token", mFacebook.getAccessToken());

mAsyncRunner.request("me/checkins", bundle, "POST", new CheckinListener(), null);

1 Answers1

0

I'm not sure of it, because I've never actually tried to use Check-In, but couldn't you use a local URL ? For example, save your byte array in a JPG file on the SDCARD, and then give a file:// URL.

Valentin Rocher
  • 11,667
  • 45
  • 59
  • Hi Valentin, thanks for your comment. I tried your suggestion, but the server returns "(#100) picture URL is not properly formatted." Here is my code: String filepath = "file://" + Environment.getExternalStorageDirectory() + "/myFolder/myPicture.png"; any other thought? Thanks. – Laichen Lai May 24 '11 at 08:45
  • maybe the final URL is wrong, I don't know. Try to see what "file://" + Environment.getExternalStorageDirectory() + "/myFolder/myPicture.png" does, and if it's a valid URL – Valentin Rocher May 24 '11 at 08:49