实施Facebook愿望清单教程应用程序不拥有操作类型错误

时间:2012-01-07 04:27:51

标签: android facebook facebook-graph-api opengraph open-graph-beta

我正在浏览适用于Android的Facebook Wishlist应用。当我尝试将自定义对象添加到Facebook图形时,API会返回以下错误:

  {
     "error: {
      "type": "OAuthExeption",
      "message":"(#100)
     Application does not own
     230752723668296 action type"
      }
     }

我无法找到有关此特定错误的任何特定文档。是否有任何Facebook开发人员可以帮助我解释这一点。

我还应该提一下,我已经有一个这个应用程序的运行示例运行没有错误(我试图复制它,所以我可以调整它,而不用担心失去工作)。我已经尝试更改Action的名称,但这没有任何区别。下面是Android代码的片段,它将项目添加到Facebook时间线。然而,这只是整个难题的一小部分,因为这个项目有三个方面(Facebook,我的服务器和Android)

 public void addToTimeline() {
       dialog = ProgressDialog.show(Wishlist.this,    "",getString(R.string.adding_to_timeline), true, true);
    /*
     * Create Product URL
     */
       String productURL = HOST_SERVER_URL + HOST_PRODUCT_URI;
       Bundle productParams = new Bundle();
       productParams.putString("name", mProductName);
       productParams.putString("image", mProductImageName);
       productURL = productURL + "?" + Util.encodeUrl(productParams);

    Bundle wishlistParams = new Bundle();

    if(mPlacesAvailable) {
        try {
            wishlistParams.putString("place", mPlacesJSONArray.getJSONObject(mPlacesListSpinner.getSelectedItemPosition()).getString("id"));
        } catch (JSONException e) {}
    }
    wishlistParams.putString("wishlist", WISHLIST_OBJECTS_URL[mWishlistSpinner.getSelectedItemPosition()]);
    wishlistParams.putString("product", productURL);
    wishlistParams.putString("image", mProductImageURL);
    //TODO
    //put the app's namespace and 'add_to' action here
    Utility.mAsyncRunner.request("me/wishlisteight:adding_to", wishlistParams, "POST", new addToTimelineListener(), null);
}

2 个答案:

答案 0 :(得分:2)

我还应该提一下,我已经有一个运行这个应用程序运行的例子没有错误(我正在尝试复制它,所以我可以调整它而不用担心失去工作)

该操作特定于应用ID。当您复制代码时,是否使用了相同的应用程序ID或创建了新的代码?如果您创建了新的应用ID,则需要为新应用注册操作,就像使用第一个应用一样。

答案 1 :(得分:2)

我在使用Graph API Explorer工具向我的应用的时间轴发布操作时遇到此错误(#100应用程序不拥有操作类型)。以下是我遇到此错误时输入的值的简短摘要以及我是如何解决该问题的。 Fyi,我的应用程序被称为'recipestogo'。我为我的应用程序定义的操作称为“cook”,关联的对象称为“recipe”。

我在Open Graph API中输入的值:

从下拉列表中选择“发布”

https://graph.facebook.com/me/recipestogo:cook?recipe=https://www.mywebsite.com/index.html

遇到错误:

100应用程序不拥有操作类型

解决: 在API Graph Explorer工具的右上角,Application旁边有一个下拉列表。它默认设置为Graph API Explorer。将此从Graph API Explorer更改为RecipesToGo解决了该问题,我能够成功发布到我的应用程序的时间轴。