Hi All,
Running into a strange issue with Game Network for Google Play.
I have a menu that allows you to login and log out as well as check leaderboards and achievements.
This all works seamlessly except when I leave the game and restart it. After the initial run I get zip. We captured a log cat and saw this error.
I/Corona ( 9944): WARNING: The ‘gameNetwork’ library is not available on this platform.
Here’s the code I’m calling, as I mentioned, it works the first time you run the game, after that we’re getting a “no gameNetwork” on subsequent restarts.
local function initCallback( event ) -- "showSignIn" is only available on iOS 6+ if event.type == "showSignIn" then -- native.showAlert( "FAIL!", "", { "OK" } ) print("NO FILE FOUND") local filePath = system.pathForFile( "center.json", system.DocumentsDirectory ) file = io.open( filePath, "w" ) file:write("[0]") \_G.loggedIntoGC=false io.close( file ) gameNetwork.request( "logout" ) gpMenu[4][2].x=27 elseif event.data then -- native.showAlert( "Success!", "", { "OK" } ) print("NO FILE FOUND") local filePath = system.pathForFile( "center.json", system.DocumentsDirectory ) file = io.open( filePath, "w" ) file:write("[1]") \_G.loggedIntoGC=true io.close( file ) gpMenu[4][2].x=-27 else gpMenu[4][2].x=27 end end function requestCallback( event ) if event.isError==true then -- native.showAlert( "FAIL2", "", { "OK" } ) gameNetwork.request( "logout" ) else gameNetwork.request( "loadLocalPlayer", { listener=initCallback } ) end end function initCallbackGoogle( event ) if event.isError==true then -- native.showAlert( "FAIL .... 1", "", { "OK" } ) gameNetwork.request( "logout" ) else -- native.showAlert( "Success .... 1", "", { "OK" } ) gameNetwork.request( "login", { userInitiated = true, listener = requestCallback }) end end