gpt4 book ai didi

Android 照片上传到 facebook 使用图形 api?

转载 作者:行者123 更新时间:2023-11-29 18:20:32 25 4
gpt4 key购买 nike

我使用 facebook sdk 从 android 应用程序将消息发布到我的 facebook 帐户上的墙上,它看起来不错但是当我使用以下 garph api 代码上传图像时,

            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");

但是我得到了以下错误,

04-26 15:01:02.005: DEBUG/UPDATE RESPONSE(9405): { "error":{"type":"OAuthException","message":"(#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");

图像的 byte = bytearray..

关于Android 照片上传到 facebook 使用图形 api?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5788436/

25 4 0
文章推荐: javascript - 从
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com