Facebook : How to check if player already login into facebook from mobile device or not?

Hello,

I’m trying to make game that connected into Facebook.
First, after this game installed, it must check if the player already login into facebook from on their mobile device or not.
If the player already login from native facebook on their mobile device, the game will begin to start,
But if not yet login, the game will show facebook login pop-up to tell player to put username & password.

My question is :

  1. Is there any way to check player has login from native facebook on their mobile device? And if it possible, how to obtain the Facebook authToken from that?
  2. How to check if Facebook authToken has expired? And is that possible to renew the facebook authToken without login or put any username & password again?

Thank you for the attention,
Regards,

The login event to your eventHandler should have an entry to the event token.  As far as knowing when it expires, I guess you could try a call and if it fails, the error message should say that the token has expired and you could test against that and re-login.

Rob

Hello Rob, 

Sorry for the late reply,

Is that mean the player must sign in on Facebook using plugin that we provide first to get the authToken?  

And there is no way to check if player has login from native facebook on their mobile device?

Regards,

That’s the way it works.  Your app calls facebook.login() which does a fast switch to the Facebook app to get permission for your app to access Facebook as the logged in person. It switches back to your app and you get an auth token.  You can’t actually check to see if they are logged in with the Facebook native app beyond this.

Rob

Oh, I see. Thank you for your explanation Rob,

Regards.

The login event to your eventHandler should have an entry to the event token.  As far as knowing when it expires, I guess you could try a call and if it fails, the error message should say that the token has expired and you could test against that and re-login.

Rob

Hello Rob, 

Sorry for the late reply,

Is that mean the player must sign in on Facebook using plugin that we provide first to get the authToken?  

And there is no way to check if player has login from native facebook on their mobile device?

Regards,

That’s the way it works.  Your app calls facebook.login() which does a fast switch to the Facebook app to get permission for your app to access Facebook as the logged in person. It switches back to your app and you get an auth token.  You can’t actually check to see if they are logged in with the Facebook native app beyond this.

Rob

Oh, I see. Thank you for your explanation Rob,

Regards.