localfunction onLoadScoreComplete(event)if event.errorCode ~=nilthenprint("error while loading players: "..event.errorDescription)elseprint("here are the details of scores:")print(event)-- how can i print?????????endend
gamekit:addEventListener("loadScoresComplete", onLoadScoreComplete)
gamekit:loadScores("grp.MyGroup")
to get my id i use this in onAuthenticateComplete event
print(event.localPlayer.playerID)
and to get score
localfunction onLoadScoreComplete(event)if event.errorCode ~=nilthenprint("error while loading players: "..event.errorDescription)elseprint("here are the details of scores:")for i=1, #event.scores doprint(event.scores[i].playerID, event.scores[i].value,event.scores[i].category)endendend
I have added a leaderboard using the gamekit to my game. But when I open the leader board it says 'no items' rather than displaying a leader board with scores.
I have added the game via iTunes connect, and created a leader board. I call gamekit:authenticate() gamekit:reportScore(score,leaderboardID) gamekit:showLeaderboard(leaderboardID)
The leaderboardID matches the id I gave it in iTunes connect.
I have set the Bundle ID in Xcode to match the Bundle ID in iTunes connect.
Enabled game centre in Xcode and in iTunes connect.
Sometimes it shows me "no items" even for app that already has a hunreds of result. I'm not sure, but may be it is iOS bug. Try to close app and open leaderboard again.
I spent a good portion of yesterday dealing with the same issue.
My fix:
As mentioned in the apple developer docs, login to Game Center using an iTunes test account instead of normal user account. You can create an iTunes test account in iTunes Connect. You can switch users by logging out of Game Center in settings app, then on the following Game Center initiation you'll get a login dialog.
In the past with other SDK's, I've been able to test using my normal user iTunes account, but no dice here. Hope this resolves your issue.
Has anyone tested the feature "invite to friend" or "challenge" in Game Center? It is not available in GameCenter plugin but it could be included in this plugin.
@jdbc as far as I was reading about challenges, they do not require any specific code and should be automatically supported in games with leaderboards, did I miss something?
Comments
tks
to get my id i use this in onAuthenticateComplete event
Likes: phongtt, vitalitymobile, Platypus, ar2rsawseen, hasanalperen, seppsepp
I have added the game via iTunes connect, and created a leader board.
I call
gamekit:authenticate()
gamekit:reportScore(score,leaderboardID)
gamekit:showLeaderboard(leaderboardID)
The leaderboardID matches the id I gave it in iTunes connect.
I have set the Bundle ID in Xcode to match the Bundle ID in iTunes connect.
Enabled game centre in Xcode and in iTunes connect.
Any idea what Im missing ?
Thanks
My fix:
As mentioned in the apple developer docs, login to Game Center using an iTunes test account instead of normal user account. You can create an iTunes test account in iTunes Connect. You can switch users by logging out of Game Center in settings app, then on the following Game Center initiation you'll get a login dialog.
In the past with other SDK's, I've been able to test using my normal user iTunes account, but no dice here. Hope this resolves your issue.
I added a test account, and now I can see a highscore table.
thanks for the help.