문제

I'm relatively new to development so some of the technical guides are a little hard for me to understand (like how to use the open graph "action" codes for curl etc.). i have created a small app that would act similarly to a facebook like (and act as a poll of sorts.. but haven't got to that part yet, will probably post it as a separate question when this is answered). my problem is with the app access token. i have no idea how to pass it on the html/php page (using page tab) together with the action. i can get an app access token for myself as well as test users using the manual url string where you replace app_id and app_secret with the necessary information, and gain access to the app. however for other users, i always get this error

{"error":{"message":"(#200) Requires extended permission: publish_actions","type":"OAuthException","code":200}}

below is the code for the action

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 + '.');
    });
}

note that FB.getLoginStatus is nested inside FB.init. FB.login is outside of FB.init.

I have also put in FB.init, FB.getLoginStatus, and FB.login on the code already. The user is being asked to login to the app and have it allow the permissions, but still the problem persists.

This is the link to the app http://www.facebook.com/TechOnePhilippines/app_446224932099458

Any help would be SO GREATLY APPRECIATED! Thanks in advance.

올바른 솔루션이 없습니다

다른 팁

can you post your login code? it is hard to see what the problem is with those codes.. that error message might highly related with publish permission.

FB.login(function(response) {
    if (response.authResponse) {
        //your code
    }else {
      //error code
    }
},{scope:'email,user_photos,publish_stream'});

try to set scope when FB.login calls..

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top