How to create a check function that the user logged in or not? I’m using isConnected but failed :(, my button only do login, not logout.
this is my code:
local function loginLogoutListener(event) local function loginListener(event1) -- Checks to see if there was an error with the login. if event1.isError then --event.target:setLabel("login") else event.target:setLabel("Logout") end end if gameNetwork.request("isConnected") then gameNetwork.request("logout") event.target:setLabel("Login") else -- Tries to login the user, if there is a problem then it will try to resolve it. eg. Show the log in screen. gameNetwork.request("login", { listener = loginListener, userInitiated = true }) end end