我需要发送短信、位图图像(不是 url!)和 Facebook 墙的链接。我尝试了两种方法:
第一个是使用me/feed
。它允许我发送消息和链接,但不能发送图片:
postParams.putByteArray("picture", data);
postParams.putString("message", "My message here");
postParams.putString("link", "http://www.google.com");
Request request = new Request(session, "me/feed", postParams, HttpMethod.POST, callback);
我收到一个异常:“图片 URL 格式不正确”。
第二种是使用me/photos
:
postParams.putByteArray("photo", data);
postParams.putString("message", "My message here");
postParams.putString("link", "http://www.google.com");
Request request = new Request(session, "me/photos", postParams, HttpMethod.POST, callback);
在这种情况下,帖子发布成功并出现在 Facebook 墙上,但没有链接
。
如何发布这三样东西?
最佳答案
解决办法很简单:必须把消息和链接结合起来:
postParams.putByteArray("photo", data);
postParams.putString("message", "My message here http://www.google.com");
//postParams.putString("link", "http://www.google.com");
Request request = new Request(session, "me/photos", postParams, HttpMethod.POST, callback);
关于android - facebook android api 发送位图、消息和链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13386370/