Facebook autologin

Hello

Im using Corona plugin for Facebook v4 :slight_smile: and im loging corectly and receiving all information.

My question is how to verify - after user proper login for  first time - that user was loged corectly and not ask second time for login and password  ???

I have usertoken :slight_smile:

greetings

Hi przelwelo,

Once you have an access token from the user, you could check the expiration date to ensure their login is still valid.

local facebook = require("plugin.facebook.v4") ... -- Do facebook.login() ... -- Grab the access token local facebookAccessToken = facebook.getCurrentAccessToken() if facebookAccessToken == null then -- User isn't logged in elseif facebookAccessToken.expiration \<= os.time() then -- Login is invalid else -- User is logged in correctly end

Hi przelwelo,

Once you have an access token from the user, you could check the expiration date to ensure their login is still valid.

local facebook = require("plugin.facebook.v4") ... -- Do facebook.login() ... -- Grab the access token local facebookAccessToken = facebook.getCurrentAccessToken() if facebookAccessToken == null then -- User isn't logged in elseif facebookAccessToken.expiration \<= os.time() then -- Login is invalid else -- User is logged in correctly end