So in short when I call login function the listener function is never called. Init functions listener is returning no errors so I guess there is no problems with build.setting or configurations in google developers.
Here is my module for this plugin:
[lua]
local gpgs = require (“plugin.gpgs”)
local achievements = gpgs.achievements
local F = {}
gpgs.enableDebug()
– listener functions
local function loginListener(event)
print("LOGIN LISTENER: ", event.name. event.isError, event.errorMessage)
end
local initCallback = function( event )
print("EVENT INIT: ", event.type, event.name, event.isError, event.errorMessage)
if not event.isError then
print(“GAMECENTER: SUCCESS!”)
else
print(“GAMECENTER Error Code:”, event.errorCode )
end
if event.name == “init” then
print(“GAMECENTER: LOGGING IN”, gpgs.isConnected(), gpgs.login)
gpgs.login({ listener=loginListener })
elseif event.name == “login” then
print(“GAMECENTER: LOGGED IN?”, gpgs.isConnected())
print("INIT LISTENER (login): ", event.name. event.isError, event.errorMessage)
end
end
F.initialize = function()
local function onSystemEvent( event )
if ( event.type == “applicationStart” ) then
print(“GAMECENTER INIT”)
gpgs.init( initCallback )
return true
end
end
Runtime:addEventListener( “system”, onSystemEvent )
end
F.show = function()
achievements.show()
end
return F
[/lua]
The F.initialize function is called in main.lua.
Here is log from device:
F.show is not working either but that is because you need to login first am I right?
Corona SDK version I use is 2017.3024
