Android 上的 Facebook 帖子到墙,仅限消息
下面的代码似乎只发布“消息”而没有其他内容。我有什么遗漏的吗? (使用 Facebook Android SDK)
parameters.putString("link", link);
parameters.putString("description", description);
parameters.putString("caption", caption);
parameters.putString("name", name);
parameters.putString("message", msg);
try {
String response = mFacebook.request("me/feed", parameters, "POST");
} catch (IOException e) {
Log.e("Error", e.toString());
}
我收到很多警告,但已阅读这是正常的(另外,我收到“消息”警告,但仍然发布:
Key caption expected byte[] but value was a java.lang.String. The default value <null> was returned.
Attempt to cast generated internal exception:
java.lang.ClassCastException: java.lang.String
The below code only seems to POST the 'message' and nothing else. Is there something I am missing? (using the Facebook Android SDK)
parameters.putString("link", link);
parameters.putString("description", description);
parameters.putString("caption", caption);
parameters.putString("name", name);
parameters.putString("message", msg);
try {
String response = mFacebook.request("me/feed", parameters, "POST");
} catch (IOException e) {
Log.e("Error", e.toString());
}
I am getting lots of warnings but have read this is normal (also, I am getting a warning for 'message' but that still posts:
Key caption expected byte[] but value was a java.lang.String. The default value <null> was returned.
Attempt to cast generated internal exception:
java.lang.ClassCastException: java.lang.String
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
检查我编辑的答案,它将发布在用户的墙上:
它将显示异常情况,但不用担心,你的帖子将会成功。
Check my edited answer, it will post on the user's wall:
It will show the exception case, but don't bother about it, your post will be succeed.
请参阅下面的代码。它正在运行代码。尝试一次。
See the below code. It's running code. Try it once.
试试这个它将与身份验证对话框一起使用
try this it will work with authentication dialog box