Facebook {page-id}/tabs 不适用于 v2 sdk

Facebook {page-id}/tabs not working with v2 sdk

我有一个还集成了 facebook 登录的网络应用程序。 由于 v1 仅在 2015 年 4 月 30 日之前可用,我已将 JS 调用更改为使用 v2 sdk (sdk.js),但 {page-id}/tabs 请求不再有效。

Facebook 响应错误:

代码:200

消息:“(#200) 此页面需要应用访问令牌或页面访问令牌”

类型:"OAuthException"

这是 api 调用:

checkForInstalledApp: function(pageId, callbackFunction){
    FB.api(pageId+'/tabs/'+appid, function(response){
        if (response && !response.error) {
            callbackFunction(response.data.length > 0);
        }
    });
}

改回 all.js 效果很好。也登录成功。目前只有 {page-id}/tabs returns 一个错误..

还有其他人遇到过这个问题吗?

根据文档,即使是阅读标签,您也必须使用页面令牌:

https://developers.facebook.com/docs/graph-api/reference/v2.2/page/tabs#read

我建议尝试使用 Page Token。

如果您不知道如何生成页面令牌,以下链接将对您有所帮助:

发现问题:

即使在 https://developers.facebook.com/docs/graph-api/reference/v1.0/page/tabs - Reading section - they specify that "A page access token is required to retrieve tabs for a Page" and we have the same thing mentioned in https://developers.facebook.com/docs/graph-api/reference/v2.2/page/tabs 中,如果我们检查更新日志,我们也会看到 "The tabs edge on the Page node now requires a Page token for GETs"。所以这实际上是特定于 v2 的内容,不应出现在 v1 文档中。

标签 api 调用如果像这样使用就可以工作:page.id+'/tabs?access_token='+page.access_token