我试图使用后的Open Graph(分享对话框法)在Android上FB自定义的故事。 该代码是工作得很好,并成功发布,直到我加入action.setPlace()。 现在分享对话框正确显示。 但是,当我点击“发布”按钮,一个奇怪的错误信息出现如下
“我们很抱歉,此信息不再可用。它可能已被删除”
而在onActivityResult(),我得到以下异常“com.facebook.FacebookException:错误发布消息”
这里是我的代码
OpenGraphObject place = OpenGraphObject.Factory
.createForPost("shellstationstunisia:shell_gas_station");
place.setProperty("title", "Shell Stations Tunisia");
place.setProperty(
"image",
"http://img1.wikia.nocookie.net/__cb20070306105202/uncyclopedia/images/4/4e/Shell_Logo.png");
place.setProperty(
"url",
"http://www.shell.com/global/aboutshell/contact-us/contact/contact-tunisia.html");
place.setProperty("description", "Best Gas Station in Tunisia");
OpenGraphAction action = GraphObject.Factory
.create(OpenGraphAction.class);
action.setProperty("shell_gas_station", place);
//Set a Place - THIS CAUSED THE PROBLEM - Place ID is correct
GraphPlace my_current_location = GraphObject.Factory
.create(GraphPlace.class);
my_current_location.setId("432170683497784");
action.setPlace(my_current_location);
@SuppressWarnings("deprecation")
FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(
this, action, "shellstationstunisia:travel",
"shell_gas_station").build();
uiHelper.trackPendingDialogCall(shareDialog.present());