No Data Available in Game Center with iOS - ios

I'm trying to make a game using Game Center and Swift with iOS. However, whenever I display my leaderboard, I'm getting a screen that says, "No Data Available." Also, my NSLogs say that the application is not recognized by Game Center. I had found online that I'm supposed to add my Game Center leaderboard ID in an asset info field, but I can't find it. Does anyone know how I can fix my problem?

I found the answer! All I had to do was change the bundle identifier from com.example... to the bundle ID used on iTunes Connect and now it works!

Related

IOS Sprite Kit Game Center Can't Add Leaderboard in Itunes Connect

I am developing a simple 2D sprite kit game for IOS. I added a leaderboard and some demo accounts to test it out and it all worked fine.
Yesterday, i decided it was time to release version 1.0 of the app and before i submitted the app for review i deleted the existing leaderboard just to make sure no fake scores from my demo accounts remain.
I then submitted the app for review and later when i tried to add a new leaderboard, the process works normally until i reach the point where i press save (to make the leaderboard active) but the button is greyed out no matter what i do. i read the documentation and searched online for similar cases and tried all of the following:
Made sure game center is enabled
chose single leaderboard
made sure the leaderbard reference name is correct
made sure the leaderboard Id is correct
Chose a score format
made sure to write the score range in numbers
create a localization language
however, the save button remains grey and i can not add a leaderboard. i tried today as well, the original leaderboard was deleted and stil the same issue. now when i try to play my game (on my test device) when i reach the end and the score should be submitted, the game crashes (since there is no leaderboard and my code submits the score at this point)
If my game is accepted and goes online it wouldn't be a good thing to have it crashing from version 1.0. I do not know what is causing this and what i can do to solve it, would appreciate any help.
Thank you

Game Center Not Showing All Items

I have just started integrating Game Center into my app and so far it has been fine.
I created a leaderboard which works perfectly, and 1 achievement which worked.
It came time to update game centre with all the other information and I have gone onto iTunes Connect and added 9 other achievements as well as adding my app icon into Game Center.
However, when I go into Game Center it appears as it did before I did those updates and I can't seem to get them to show, this includes my app icon, there is nothing there, just the leaderboard which is still updating fine, and the first achievement I made. The other 9 and my icon are nowhere to be seen?
Has anyone had this problem or know any fixes? Id like to be able to test the other achievements before submitting for approval.
Thank you in advance.
When you are submitting your update (in iTunes Connect) you need to make sure that you are checking off to add each of the new achievements.
Just because you create them does not mean you apply them to the update!

How to invite players through game centre app in iOS 7?

I've already implemented auto-matchmaking, and tested it between two actual devices with different game centre accounts, so I know I've setup that part correctly: I can create a match, and send data between both the players. Now I'm implementing the invitations part.
The Game Center programming guide
says:
The playersToInvite parameter is non-nil when your game is launched
directly from the Game Center app to host a match. This parameter
holds an array of player identifiers listing the players to invite
into the match.
What I don't understand, is how to invite players through the game centre app. In the game centre app, I can see my game. When I click on it, in the top right corner there is a button with text: "..." . When I click on it, I see two options: "Play" and "Share". Clicking on "Play" launches my app.
Is there some code I need to implement for the Game center app to present me with the option of selecting friends to invite etc?
EDIT: It appears that the person in this post has almost the same problem as me:
Definitive answer to what playersToInvite is for
But no definitive answer so far, on how that data gets populated.
There are actually a couple of problems, both of which are on apples end:
The documentation is not up to date. While it mentions to use [GKMatchMaker sharedMatchMaker].inviteHandler , it has actually been deprecated in iOS 7, but the documentation has not been updated to reflect this.
It appears that there is no way you can invite players from the Game Center app. The documentation is incorrect in this case - the game centre UI does not provide any way for selecting the players. You invite players using the matchmaking view controller provided by game center.
Instead of using GKMatchMaker.inviteHandler, one can implement GKLocalPlayerListener - but this hasn't been documented properly in the Game Center Programming guide. It is easy to implement as there are only two methods, and work in almost the same way as the deprecated handler.
EDIT: There is a way to invite players from the game center app, but currently there is a bug in iOS 7, so that the game center app's flow in production, does not match the flow in the sandbox. As a result, one must navigate a much more cryptic flow to find the option to invite a player through the game center app. Currently only one player can be invited through the game center app, even if your app supports more than two players.

Game Center Leadboards not Showing and In Apps not working

I have been developing a client game. I have enabled game center from iTunesConnect, created leaderboards and also created InApps. But when I try to call them in the code, there is no response. Game Center is showing no items and in apps are giving any response i.e products are not loaded. Everything is correct, provisioning is correct, bundle id is setup correctly, game center and in apps are enabled. I tried the same code with my own game center and in apps and they worked fine. One thing missing in client's itunes connect is Contact and Tax Information. Is that the problem? Thats why apple isnt allowing me to add game center and in apps? Thanks

Make my game recognize Game Center?

Well, I made my game in iTunes Connect page, enabled Game Center.
I manage to make my game recognize Game Center and work with it.
But now, after some time, I got a couple things messed up, and forgot what setting I needed to change in XCode so my game could recognize Game Center. Any tips?
In your frameworks, include the GameKit framework and it should work..
Remember to import the gamekit framework as well whenever you need it in a class..

Resources