我对开发比较陌生,所以一些技术指南对我来说有点难以理解(比如如何使用开放图形“动作”代码进行 curl 等)。我创建了一个小应用程序,它的行为类似于 facebook 之类的(并充当各种民意调查......但还没有到那部分,可能会在回答时将其作为一个单独的问题发布)。我的问题是应用程序访问令牌。我不知道如何将它与操作一起传递到 html/php 页面(使用页面选项卡)。我可以使用手动 url 字符串为自己获取应用程序访问令牌以及测试用户,您可以在其中将 app_id 和 app_secret 替换为必要的信息,并获得对应用程序的访问权限。但是对于其他用户,我总是收到此错误
{"error":{"message":"(#200) Requires extended permission: publish_actions","type":"OAuthException","code":200}}
下面是动作的代码
FB.init({
  appId      : '446224932099458', // App ID from the App Dashboard
  status     : true, // check the login status upon init?
  cookie     : true, // set sessions cookies to allow your server to access the session?
  xfbml      : true  // parse XFBML tags on this page?
});
FB.getLoginStatus(function (response) {
    if (response.status === 'connected') {
        // connected
        testAPI();
    } else if (response.status === 'not_authorized') {
        // not_authorized
        login();
    } else {
        // not_logged_in
        login();
    }
function login() {
    FB.login(function (response) {
        if (response.authResponse) {
            // connected
        } else {
            // cancelled
        }
    }, {scope: 'publish_actions,publish_stream'});
}
function testAPI() {
    console.log('Welcome!  Fetching your information.... ');
    FB.api('/me', function (response) {
        console.log('Good to see you, ' + response.name + '.');
    });
}
请注意,FB.getLoginStatus 嵌套在 FB.init 中。FB.login 在 FB.init 之外。
我已经在代码中加入了 FB.init、FB.getLoginStatus 和 FB.login。用户被要求登录到应用程序并让它允许权限,但问题仍然存在。
这是应用程序的链接 http://www.facebook.com/TechOnePhilippines/app_446224932099458
非常感谢任何帮助!提前致谢。