Code Monkey home page Code Monkey logo

Comments (3)

pc035860 avatar pc035860 commented on August 18, 2024

Hi @shadowsyntax ,

Sorry for the late response.
I'm not familiar with either Ionic or Firebase, but I suggest that you can try wrapping .logout() with .getLoginStatus(), which might solve the called without an access token error.

ezfb.getLoginStatus(function (response) {
  if (response && response.status === 'connected') {
    ezfb.logout();
  }
});

The thing is that Facebook JS SDK actually tries to maintain an active access token in it, which seems can only obtained through calling .getLoginStatus().

See also: FB.logout() called without an access token. javascript sdk

from angular-easyfb.

greemwahr avatar greemwahr commented on August 18, 2024

Hello @pc035860, I tried your trick and it works fine now. My apologies for getting back to you so late, been tackling some other programming issues.

Thanks a lot.

from angular-easyfb.

dragipostolovski avatar dragipostolovski commented on August 18, 2024

To use the access token with the FB.logout method, you need to ensure that you have obtained the access token during the login process and that it is available when you want to log out the user.

FB.logout(function(response) {
                
    if ( 'connected' === response.status ) {
        window.location.href = data.render.logout_url;
    } else {
        console.log( 'There has been an error.' );
    }
}, {
    access_token: data.render.accessToken
});

from angular-easyfb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.