Updating Facebook app settings via Graph API

▼魔方 西西 提交于 2020-01-06 12:46:09

问题


I have a problem with updating app settings via Graph API using Javascript SDK. I followed the documentation (https://developers.facebook.com/docs/graph-api/reference/app) and tried this code:

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

The response is true but I see no changes in the application settings page in Facebook Developers (no matter which properties I am trying to change).

Can anyone help?


回答1:


Don't use object-

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
     //}
   }
);


来源:https://stackoverflow.com/questions/23308020/updating-facebook-app-settings-via-graph-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!