iOS game center leaderboard fake data - ios

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.

Related

can you create multiplayer game on ios without enabling game center

I am trying to understand to what extent the games that have game center enabled are multiplayer games. Please help me understand following questions:
a) Is it possible to create a multi-player game without enabling game-center
b) Can a game with game-center enabled be a single-player game.
Is it possible to create a multi-player game without enabling game-center?
It is definitely possible, but harder to spin up. Without GameCenter, you need to create your own servers, store game sessions, handle game data being transferred from player to player, and other non-trivial things. GameCenter basically says “Don’t worry about all that network and infrastructure, we got it covered. All you need to do is use our framework.”
Can a game with game-center enabled be a single-player game?
Also a yes! You can actually build a game without GameCenter and let you app handle everything. GameCenter is useful here when you want to add a leaderboard, let players compete with other players, enable high scores, etc.

How do I deal with save game data when changing Apple ID on ios device

This comes close to an opinion question, but I hope that someone can give a definitive answer.
I have written a game app and I save game data locally. But I also will want it to be cloud capable and I am currently writing the code but I keep hitting a mental barrier. In several places in the iCloud and Game Center documentation it says if I change Apple ID, I need to delete the local save game data/file cache. This is contrary to how my app currently works, which is OK if I can figure out the right way to do it. In the ICloud documentation it says to either user the cloud or don't use the cloud and only ask once, but there is a button in the settings to turn the iCloud Drive on and off.
The core of my dilemma seems to be that an IOS device is not tightly linked to one Apple ID. I understand that multiple devices can be associated with one Apple ID, but not why it should be true the other way around.
This can be seen as either added capability or enough rope to hang oneself. As a user I can, using my Apple ID, get on to another device not associated with my Apple ID and:
download an App/Song
log into Game Center and play a game we both own.
etc.
I know Apple deals with this and now I have to do the same.
As App Developer I see a world of questions about what this might mean, like "Well I'll do this or that but what do I do the first time this other thing happens?", etc.
For example, initially I thought I could consider "local" store the same as a very long airplane mode, and when the cloud became available I could sync the delta to the cloud and across devices, but this does not address changing Apple ID. Do I blow away the local data, keep the new user from playing the game, only allow local or cloud but not both?
Now Apple is adding Multitasking, and a login to iPad's used in schools, the problems become even worse.
I keep trying to find some profundity that will steer me to the correct answer but I am at a loss on how to deal with Apple ID changes.

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 - 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

inter-device communication

I am looking at device to device communications and need some direction.
I have a series of applications that will need to update each other with information, or simply tell each other there is a new dataset that is ready to be read and updated on the local machine.
I was thinking about using something out of the gamekit, but I want to know if this is the best approach.
Currently, I have a few iPads in a doctors office, everything is working OK, but the doctors are not seeing updates between devices when a user makes an update to the same patient, I need the other devices that are looking at the same patient to be updated/notified there are changes, and I can reload the data from the database.
Each device belongs to a practice, and I have the MAC addresses of each device.
Yes, Game Kit is the way to go. Game Kit will handle almost everything for you.

Resources