我正在尝试使用Open Graph(共享对话框方法)在Android中发布FB Custom故事。代码运行良好并成功发布,直到我添加了action.setPlace()。现在,“共享”对话框正确显示。但是,当我点击' POST'按钮,一个奇怪的错误信息如下
"很抱歉,此帖已售罄。它可能已被删除"
在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());
答案 0 :(得分:1)
我自己解决了这个问题。这是一个身份验证问题。我不得不从FB Developer Panel启用'Place'功能。只需按照以下步骤进行操作,
现在你的应用程序可以正常工作:)
答案 1 :(得分:1)
我通过这种方式解决了这个问题:
希望这可以帮到你!