Android的照片上传到Facebook使用图形API? [英] Android photo upload to facebook using graph api?

查看:287
本文介绍了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");

其中,字节=字节组形象。

这篇关于Android的照片上传到Facebook使用图形API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆