local gameNetwork = require "gameNetwork" local loggedIntoGC = false -- called after the "init" request has completed local function initCallback( event ) if event.data then loggedIntoGC = true native.showAlert( "Success!", "User has logged into Game Center", { "OK" } ) else loggedIntoGC = false native.showAlert( "Fail", "User is not logged into Game Center", { "OK" } ) end end -- function to listen for system events local function onSystemEvent( event ) if event.type == "applicationStart" then gameNetwork.init( "gamecenter", initCallback ) return true end end Runtime:addEventListener( "system", onSystemEvent )
and I always get “Fail, User is not logged into Game Center”.
Of course I have enabled the Game Center in iTunes Connect.
Then, I would like to show the leatherboard, that I have setted up via iTunes Connect.
According to the Corona documentation, the code I have to use is:
99% likely reason for this issue is that on iOS 8.x, you need to enable to Game Center “sandbox” for testing. On the device, go under Settings > Game Center and look for the “Sandbox” switch (then turn it on). If that switch does NOT appear there, make sure that your device is configured as a “Developer” device within Xcode.
Trying to show the “com.appledts.EasyTapList” leaderboard isn’t really applicable to your own test app. That’s a leaderboard used for testing with Apple’s “GKTapper” account. You should specify your own leaderboard category instead.
I do not recommend using that ancient tutorial on Game Center. Some of it may still be valid, but a better resource is actually the documentation for the Game Center plugin:
99% likely reason for this issue is that on iOS 8.x, you need to enable to Game Center “sandbox” for testing. On the device, go under Settings > Game Center and look for the “Sandbox” switch (then turn it on). If that switch does NOT appear there, make sure that your device is configured as a “Developer” device within Xcode.
Trying to show the “com.appledts.EasyTapList” leaderboard isn’t really applicable to your own test app. That’s a leaderboard used for testing with Apple’s “GKTapper” account. You should specify your own leaderboard category instead.
I do not recommend using that ancient tutorial on Game Center. Some of it may still be valid, but a better resource is actually the documentation for the Game Center plugin: