javascript - 通过 Graph API 更新 Facebook 应用程序设置

标签 javascript facebook facebook-graph-api facebook-javascript-sdk

我在使用 Javascript SDK 通过 Graph API 更新应用程序设置时遇到问题。我按照文档( https://developers.facebook.com/docs/graph-api/reference/app )并尝试了以下代码:

FB.api(
    "/APP_ID/?access_token=APP_ID|APP_SECRET",
    "POST",
    {
        "object": {
            "canvas_url": "Test about text",
            "migrations": "{'secure_stream_urls': true}",
            "restrictions": "{'age': '21+', 'type': 'alcohol'}"
        }
    },
    function (response) {
      if (response && !response.error) {
        console.log(response);
      }
    }
);

响应为true,但我在 Facebook 开发者中的应用程序设置页面中看到没有任何更改(无论我尝试更改哪些属性)。

有人可以帮忙吗?

最佳答案

不要使用对象-

FB.api(
   "/APP_ID/?access_token=APP_ID|APP_SECRET",
   "POST",
   {
      "canvas_url": "Test about text",
      "migrations": "{'secure_stream_urls': true}",
      "restrictions": "{'age': '21+', 'type': 'alcohol'}"
   },
   function (response) {
     //if (response && !response.error) {
       console.log(response);   // console the complete response for any errors
     //}
   }
);

关于javascript - 通过 Graph API 更新 Facebook 应用程序设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23308020/

相关文章:

javascript - 打印功能在 chrome 中不起作用

javascript - 在 Electron 无法连接到 URL 时设置占位符图像/HTML

javascript - Facebook 错误 100 : You cannot specify a scheduled publish time on a published post

javascript - 如何阻止 gif 动画循环播放

javascript - 变量似乎是耦合的

iphone - 如何使用 Graph api 将图像与文本一起发布?

ios - Facebook 似乎随机出现在我的项目中

javascript - getaddrinfo ENOTFOUND https ://graph. facebook.com/

python - 使用 python 请求模块的 Facebook 图形 GET 请求-证书验证失败

javascript - 关于多个 facebook Json 请求的性能建议