Hi Develephant,
thank you for this amazing hard work, you moved from a lower place as developer to an upper one, thank so much for this.
I still have one problem if you don’t mind. I cannot check if session has expired or not, because obviously the function doesn’t work, and I get error that says :
File: mod_parse.lua
Line: 568
User must be logged in first, sessionToken cannot be nil.
my code is :
[lua]
local parse = require(“mod_parse”)
parse:init({
appId = “…”,
apiKey = “…”
})
parse.showStatus = true
–count event
–parse:appOpened()
–parse:logEvent( “Share”, { [“screen”] = “splash” } )
–parse:logEvent( “Share”, { [“screen”] = “results” } )
local function onCreateUser( event )
print( event.response.createdAt )
print( event.response.sessionToken )
end
local userData = { [“username”] = “Ali”, [“password”] = “121212” }
– parse:createUser( userData, onCreateUser )
local function onLoginUser( event )
if not event.error then
print( event.response.objectId )
--check if user is verified
if event.response.emailVerified then
--user is verified
end
end
end
parse:loginUser( { [“username”] = “Ali”, [“password”] = “121212” }, onLoginUser )
local function onGetMe( event )
if event.code == parse.EXPIRED then
print( “Session expired. Log in.”)
else
print( “Hello”, event.response.username )
end
end
parse:getMe( onGetMe )
[/lua]
I want to know how to fix this and continue learning about your great _mod.
thanks.