Download data from Game Center - ios

I got an iOS app. There is one main function - i need to know all data from iOS Game Center. I talk about game names and scores in this games. I want to collect statistics and scores about all games in user's game center.
How should i do it? Thnx

How about reading the documentation and asking more specific questions if you run into any trouble?

Related

Can Game Center Track total time played?

Curious to know if Game Center tracks total time played per app? If it does, how could I easily query this data?
Thanks!
No, you cannot use game center to do this. There are a couple of options though.
You can track it locally, and then upload the data to a game center leaderboard. I don't know if you want to do that though because then everyone can see how much a certain player has played
You can use some sort of analytics service, like Google Analytics and ping it periodically while a player is on the app so you can see how much people are playing
Or you can set up a server and database, where the player sends their play time when they are on the app

Do iOS Game Center turn based games use Apple servers?

If I implemented a Game Center game on iOS using their turn based functionality will the game operate on Apple servers alone?
No further cost to me?
I'd probably use gkturnbasedmatch from what I've seen.
I am making an iOS board game and it occurred to me that I might be able to add online multiplayer. The simplest and cheapest option for me would be if I could do it all from ios sdk. I'm not interested in paying for a server.
If it does work then what are the limitations?
Please only provide an answer if it's current. I think early Game Center was much more limited. It might not have had gkturnbasedmatch for instance.
I am developing in iOS 8 and swift.
From the Apple Documentation on Turn-Based Matches.
Game Center is primarily responsible for storing data. You are
responsible for providing the game logic that uses this
infrastructure. In particular, you define:
What data must be stored on Game Center
When the match data needs to
be updated
When play passes to another player
Limitations:
Size of matchData - 64KB
Each player can participate in up to 30 simultaneous matches in a turn-based game.
Note that games that have ended still count until the user removes them (e.g. from the GKTurnBasedMatchmakerViewController).

iOS game center leaderboard fake data

I am implementing game center leaderboard to my game and would like to use the leaderboard data to influence the gameplay.
My question is how to add fake data with different playerID into my sandbox game center so that I can test my feature.
I tried run the game both on simulator and device with different sandbox game center account, but I don't understand why, they can only see "ME" in the leaderboard, not as expected seeing two different players.
Then I tried switch different game center accounts on the same device, but same problem, there is only "ME" on the leaderboard.
I have been googling this issue for a while but cannot find anything related.
To clarify my purpose again at the end, I just want to find an easy way to add fake data in my sandbox leaderboard so that I can test my feature, pretty much it. :P
Thanks for helping out! :D
I don't believe it's possible to do that. What you can do is put fake data into your app. Define a protocol that lets you get players and their scores (or positions in the leaderboard, if that's what you need). For testing, supply a class that conforms to the protocol, that uses test data. In the wild, switch this for a class that gets its data from Game Center.
Game Center seems quite flaky when it comes to running on a device and on the simulator - when testing challenges they very rarely get through between the two. It's also not very good at recognising user changes on the same device. From my tests it seems much more reliable if you have two or more actual devices running the game when testing Game Center features.

iOS - turn-based game with GameKit?

From the research I've done, GameKit seems to be mostly about leaderboards and achievements. I am trying to develop a turn-based game like Words with Friends or Checkers. Can GameKit be used for this? The Game Center app seems to require you and your friend to simultaneously have the app open and invite each other to play. I want the Words With Friends approach where you receive notifications that your friend has made a move. Can GameKit do this?
If not, how is this achieved?
GameCenter can be utilized for both real-time and turn-based, check out the tutorial here: http://www.raywenderlich.com/5480/beginning-turn-based-gaming-with-ios-5-part-1. It has two parts with the second one contains most of the game logic. The project code is also downloadable.
It's worth checking out the new GameKit APIs in iOS 5. GKTurnBasedMatch should probably do the trick if you haven't rolled your own solution yet.
Using GKTurnBasedMatch in the new iOS 5 SDK will allow you to do this
I've some suggestions for you. You can use GKTurnBasedMatch class for the reference. In GKTurnBasedMatch you will find
1)Retrieving Existing Matches,
2)Creating a New Match,
3)Retrieving Information About the Match,
4)Retrieving the Match’s Custom Data,
5)Handling the Current Player’s Turn,
6)Leaving a Match,
7)Ending a Match and Deleting a Match From Game Center.
However you can also read detailed description here about this class. For more details visit following link.Thanks
http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKTurnBasedMatch_Ref/Reference/Reference.html
GameKit / Game Center can be used to solve many of the social gaming aspects you might need, but the actual game play (ala Words with Friends) would need a server that has web services created specifically for the rules of your game.
There are many threads here about webservices, here are a few:
Best way of using web services on iOS?
iPhone REST client
Using a REST API and iPhone/Objective-C

Game Center Challenges

Open Feint has a notion of challenges -- where a player can finish a game and then send a challenge to another user (like a "beat my score"). The app passes along whatever game data it needs to the OF servers and then when the challenge is accepted, the info is downloaded and the challenge is started.
Is there something similar in Game Center? I've been looking through their docs, but it seems they are more interested in live multiplayer scenarios.
Andrew
To do this, you need to have your own server, and you should use Push Notifications. It's not (yet) possible with Game Center at the time of writing (4 november 2010). However, iOS 4.2 is coming soon and it has many new things. :)
Check for the new APIs released at 2012's WWDC ;)

Resources