Android的照片上传到Facebook使用图形API?
问题描述:
我使用Facebook SDK发布的消息墙从Android应用程序,它看起来很不错,但是当我使用garph API以下code上传的图像,
i use the facebook sdk to post message to wall on my facebook account from android application , its looking fine but when i use the following code of garph api to upload the image ,
Bundle bundle = new Bundle();
bundle.putString("message", "Viddygo Video Sharing");
bundle.putString(Facebook.TOKEN,accessToken);
bundle.putString("image", "http://simplestrength.com/wp-content/uploads/kanji_luck.png");
String response = facebook.request("me/photos",bundle,"POST");
但我得到了下面的错误,
but i got the following error,
04-26 15:01:02.005:DEBUG /更新响应(9405):{错误:{类型:OAuthException,消息:(#324)要求上传文件}}
答
只是试试这个
bundle.putString("picture", "http://simplestrength.com/wp-content/uploads/kanji_luck.png");
String response = facebook.request("me/feed",bundle,"POST");
有关职位的专辑。
bundle.putByteArray("picture", byte);
String response = facebook.request("me/photos",bundle,"POST");
其中,字节=字节组
形象。