【发布时间】:2016-09-19 21:18:14
【问题描述】:
我正在查看此 Facebook API 文档,但您认为为了阅读页面的公开照片,您需要征得用户的许可才能连接到他们的 Facebook 帐户,这不是真的吗?
这样的事情失败了。
/* make the API call */
FB.api(
"/{album-id}",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
错误提示:
"An access token is required to request this resource."
那么现在我找不到一种方法(这并不过时)让 API 调用获取访问令牌而不提示访问者接受任何内容。
我忽略了什么?
更新:这行得通。而且我知道不要在客户端存储应用程序机密。
FB.api(
'/{album-id}',
'GET',
{'access_token':'{app-id}|{app-secret}'},
function(response) {
/* handle the result */
}
);
【问题讨论】:
标签: javascript facebook facebook-graph-api facebook-javascript-sdk