在android中共享facebook墙上的链接
有人能帮我理解如何在facebook墙上分享链接吗 公共类SampleDialogListener扩展了BaseDialogListener{在android中共享facebook墙上的链接,android,facebook,Android,Facebook,有人能帮我理解如何在facebook墙上分享链接吗 公共类SampleDialogListener扩展了BaseDialogListener{ public void onComplete(Bundle values) { final String postId = values.getString("post_id");/////// Log.d("Facebook-Example", "Dialog Success! post_
public void onComplete(Bundle values) {
final String postId = values.getString("post_id");///////
Log.d("Facebook-Example", "Dialog Success! post_id=" + postId);
if (postId != null) {
Log.d("Facebook-Example", "Dialog Success! post_id=" + postId);
mAsyncRunner.request(postId, new WallPostRequestListener());
mDeleteButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mAsyncRunner.request(postId, new Bundle(), "DELETE",
new WallPostDeleteListener(), null);
}
});
mDeleteButton.setVisibility(View.VISIBLE);
} else {
Log.d("Facebook-Example", "No wall post made");
}
}
}
我得到了post_id的空值。您可以使用以下代码实现这一点
Bundle parameters = new Bundle();
parameters.putString("message", "Test Photo");
parameters.putString("attachment", "{\"name\":\"My Test link\","
+"\"href\":\""+"http://www.google.com"+"\"}");
facebookClient.dialog(this, "stream.publish", parameters, this);
您可以使用以下代码实现这一点
Bundle parameters = new Bundle();
parameters.putString("message", "Test Photo");
parameters.putString("attachment", "{\"name\":\"My Test link\","
+"\"href\":\""+"http://www.google.com"+"\"}");
facebookClient.dialog(this, "stream.publish", parameters, this);
要共享消息,只需再添加一个参数,如下所示:
params.putString("caption", "Test Photo");
要共享消息,只需再添加一个参数,如下所示:
params.putString("caption", "Test Photo");
感谢您提供的解决方案……“我的测试链接”已共享,但消息“测试照片”仍不共享……有人可以帮助吗……感谢您提供的解决方案……“我的测试链接”已共享,但消息“测试照片”仍不共享……有人可以帮助吗。。。