Sorry if this has been posted before, but I’m running what is basically the code from the Game Center API doc page sample and using a developer provisioning profile (XCode sim and device) I constantly get the Game Center unavailable error. Here’s my code:
-- called after the "init" request has completed local function initCallback( event ) if event.type == "showSignIn" then controller.gameboard:pause() elseif event.data then loggedIntoGC = true if (controller.isdebug) then native.showAlert( "Success!", "User has logged into Game Center", { "OK" } ) end else loggedIntoGC = false if (controller.isdebug) then native.showAlert( "Fail", "User is not logged into Game Center", { "OK" } ) end end end function controller:system( event ) print('event.type', event.type) if (event.type == "applicationStart") then gameNetwork.init( "gamecenter", initCallback ) analytics.logEvent( "StartApp" ) elseif (event.type == "applicationExit") then -- save state, options controller.options:appExit() controller.gamestate:appExit() analytics.logEvent( "ExitApp" ) elseif (event.type == "applicationSuspend") then -- save state, options controller.options:appExit() elseif (event.type == "applicationResume") then gameNetwork.init( "gamecenter", initCallback ) if (controller.gamestate.playState) then controller.gameboard:pause() end end return true end Runtime:addEventListener( "system", controller )
I would love suggestions or a common solution, if anyone has one to give.
Thanks,
Matt.