Before any one asks there is not way to test on macOS except publishing to app store. Please test on iOS (or apple tv). It should function the same, just make sure you set up and put in the right identifier.
Please note an update in docs. In short , Apple does not have a leaderboard to show so calling leaderboards.show just shows the achievements pop up. You should just make your own leaderboard pop (via display objects and loadScores API)
Help! Why can’t I load up the Game Center?
I’m trying to start-up the gamecenter using the docs and info I’ve found online. What am I doing wrong? I’m getting Runtime error: ERROR: Could not load provider (gamecenter) due to the following reason: module ‘Corona-Provider.gameNetwork.gamecenter’ not found: resource (CoronaProvider:gameNetwork.gamecenter.lu) does not exist in archive no field package.preload['Corona-Provider.gameNetwork.gamecenter"] no file '/var/containers/Bundle/Application/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/ etc…
in my game:
…
elseif t==“applicationStart” then
gameNetwork=require(“gameNetwork”)
local loggedIntoGC = false
local function initCallback(event)
if event.type==“showSignIn” then
– This is an opportunity to pause your game or do other things you might need to do while the Game Center Sign-In controller is up.
elseif event.data then
loggedIntoGC=true
native.showAlert(“Success Test for Game Center Login!”,"",{“OK”})
end
end
gameNetwork.init(“gamecenter”,initCallback)
return true
end
From what I can tell, the gameCenter documentation on Scott’s page is different than in the Corona API documentation - so perhaps this should be updated. This works for me on Mac OS, but I’m assuming it will also work on iOS. The init code is as simple as follows:
(extracted from: https://scotth.tech/plugin-gamecenter) local gc = require "plugin.gamecenter" gc.init(function(e) print("init") print("----------") print(json.encode(e)) print("----------") if(e.status == "signed in") then end end)
(SOLVED) Well, combing through the newest documentation from Scott H, I did find “gc.player – handles player data”. Doing a search on this documentation page for loadLocalPlayer (the term used in the Game Center documentation) doesn’t show any results and is why I encountered this problem; hense the last several posts.
@Scott, you might want to make some references in your documentation to the Game Center equivilents. I think this may save others (like me) time when implementing this.
I just came across an online comment that since iOS 9, iOS Game Center photos have been killed server-side. I’m guessing this is why Scott’s latest version does not include the photo info.