Android的SDK的Facebook - action.setPlace错误自定义的故事在Andorid的(饲料对话框法) [英] Android Facebook SDK - action.setPlace Error in Custom Stories in Andorid(Feed Dialog Method)

查看:238
本文介绍了Android的SDK的Facebook - action.setPlace错误自定义的故事在Andorid的(饲料对话框法)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Android的开放图谱(分享对话框法)来发布FB自定义的故事。在code的工作非常出色,并成功发布,直到我加入action.setPlace()。现在,共享对话框正确显示。但是,当我点击POST按钮,一个奇怪的错误消息来自如下:

很抱歉,这个职位是不再可用。它可能已被删除

和中的onActivityResult(),我得到了以下异常com.facebook.FacebookException:错误消息发布

下面是我的code

  OpenGraphObject地方= OpenGraphObject.Factory
            .createForPost(shellstationstunisia:shell_gas_station);
    place.setProperty(称号,壳牌站突尼斯);
    place.setProperty(
            图片,
            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(说明,在突尼斯最好的加油站);    OpenGraphAction行动= GraphObject.Factory
            .create(OpenGraphAction.class);
    action.setProperty(shell_gas_station的地方);    //设置一个地方 - 这引起了问题 - 将ID是正确的
    GraphPlace my_current_location = GraphObject.Factory
            .create(GraphPlace.class);
    my_current_location.setId(432170683497784);
    action.setPlace(my_current_location);
    @燮pressWarnings(德precation)
    FacebookDialog shareDialog =新FacebookDialog.OpenGraphActionDialogBu​​ilder(
            这一点,动作,shellstationstunisia:旅行,
            shell_gas_station),建立()。    uiHelper.trackPendingDialogCall(shareDialog present());


解决方案

我自己解决了这个问题。这是一个身份验证问题。我不得不启用从FB开发小组'将'Capabilites。只要按照下面的步骤,


  1. 在developers.facebook.com,打开您的应用的仪表板。

  2. 在左窗格中,打开开放图谱。

  3. 选择动作类型标签

  4. 选择为其你获得上述的错误。
  5. 的操作类型
  6. 向下滚动到款,你会发现'能力'栏目

  7. 打开地点或您想使用任何其他功能

  8. 单击保存更改。

现在您的应用程序将很好地工作:)

I am trying to post a FB Custom story in Android using Open Graph(Share Dialog Method). The code was working very well and posted successfully, until I had added action.setPlace(). Now the Share dialog is appearing correctly. But when I click the 'POST' button, a wierd error message comes as follows

"We are Sorry, this post is no longer available. It may have been removed"

And in onActivityResult(), I get the following exception "com.facebook.FacebookException: Error publishing message"

Here is my code

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());

解决方案

I solved the problem by myself. It was an Authentication issue. I had to enable 'Place' Capabilites from FB Developer Panel. Just follow the steps given below,

  1. In developers.facebook.com, open your app dashboard.
  2. In the Left pane, open 'Open Graph.
  3. Select 'Action Types' tab
  4. Select the Action type for which your getting the above mentioned error.
  5. Scroll down to the section and you will find 'Capabilities' Section
  6. Turn ON 'Place' or any other capability which you would like to use
  7. Click Save Changes.

Now your app would work fine :)

这篇关于Android的SDK的Facebook - action.setPlace错误自定义的故事在Andorid的(饲料对话框法)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆