I just pushed a new release and with more bug catching protection
top to bottom is a
Samsung A running Android 15
Pixel 2xl running Android 11
Pixel 6a running Android 15
See video
All are using release from today
Here is full code
local googleSignIn = require "plugin.googleSignIn"
local json = require("json")
local widget = require("widget")
googleSignIn.init({
ios={
clientId = "817533502476-bsnsu8ivj593flerfh1va02clkh09dtk.apps.googleusercontent.com"
},
android={
clientId = "652763858765-umba64d6ddcr1ihsfcu16p6sqkarqf79.apps.googleusercontent.com"
}
})
timer.performWithDelay(5000, function()
print("Silent Sign In")
googleSignIn.silentSignIn(function (e)
print(json.encode( e ))
if (e.isError) then
print(e.error)
else
print("successful silent sign in")
end
end)
end)
local bg = display.newRect( display.contentCenterX, display.contentCenterY, display.actualContentWidth, display.actualContentHeight )
bg:setFillColor( 0,0,1 )
local title = display.newText( "Google Sign In", display.contentCenterX, 40, native.systemFontBold ,30)
function googleListener(event)
print("googleListener event: " .. event.status)
print("googleListener event: " .. json.encode(event))
if (event.isError == true) then
native.showAlert("Error Sign In", event.error, {"Ok"})
elseif(event.status == "cancelled") then
native.showAlert("Sign In Cancelled", json.encode(event), {"Ok"})
elseif(event.status == "signed in") then
native.showAlert("Signed In", json.encode(event), {"Ok"})
elseif(event.status == "signed out") then
native.showAlert("Signed Out", json.encode(event), {"Ok"})
end
end
function signIn_onEvent(event)
if(event.phase == "ended")then
googleSignIn.signIn(function (e)
if (e.isError) then
print(e.error)
else
native.showAlert( "Signed In Successfull", json.encode(e), {"Ok"} )
print(json.encode( e ))
print("you are signed in")
end
end)
end
end
local signIn = widget.newButton( {
label = "Sign In",
fontSize = 20,
labelColor = { default={ 1, 1, 1 }, over={ 0, 0, 0, 0.5 } },
x = display.contentCenterX,
y = display.contentCenterY,
onEvent = signIn_onEvent
} )
function signOut_onEvent(event)
if(event.phase == "ended")then
googleSignIn.disconnect(googleListener)
googleSignIn.signOut(googleListener)
end
end
local signOut = widget.newButton( {
label = "Sign Out/Disconnect",
fontSize = 20,
labelColor = { default={ 1, 1, 1 }, over={ 0, 0, 0, 0.5 } },
x = display.contentCenterX,
y = display.contentCenterY+100,
onEvent = signOut_onEvent
} )
@solar_dev let me know if you are experience any more issues. Please include logs and sample code to reproduce
Thanks
Scott