我在使用 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/