I'm building a Phonegap app, and am using the Facebook Javascript API to log users in. My code is as follows:

 FB.login(function(response) {
     if (response.authResponse) {
       console.log('Welcome!  Fetching your information.... ');
     FB.api('/me', function(response) {
       console.log('Good to see you, ' + response.name + '.');
     });
  } else {
     console.log('User cancelled login or did not fully authorize.');
     }
  });

Sure, this works fine for logging users in, but how can I KEEP them logged in, even after the app is closed?

Member Avatar for LastMitch

this works fine for logging users in, but how can I KEEP them logged in, even after the app is closed?

I'm pretty sure that code you provided is not related to the question you ask.

You need JSON/Ajax/OAuth to maintain a member session after the app is closed but still be login on facebook.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.