Synopses & Reviews
Now that Apple has introduced the GameKit framework to its iOS SDK, you can integrate Game Center features directly into your iPhone and iPad apps. This concise cookbook shows you how it's done, with 18 targeted recipes for adding leaderboards, user authentication, achievements, multiplayer games, and many other features.
How do you display players' scores and achievements? How do you create Game Center accounts and add friends? Each recipe in this book includes a simple code solution you can put to work immediately, along with a detailed discussion that offers insight into why and how the recipe works.
Recipes include techniques to:
- Set up Game Center for an iOS App
- Use block objects and Grand Central Dispatch to write Game Center apps
- Authenticate a local player in Game Center
- Use iTunes Connect to create leaderboards and achievements
- Retrieve leaderboard and achievement information programmatically
- Handle players' state changes in multiplayer games
When iOS SDK was released to the public, because of the nature of hardware and software used in iOS devices, developers immediately recognized the amazing power in these devices and started to write games for the iPhone and now for the iPad. Developers had to write custom code to manage gamers? scores, manage leaderboards, initiate multiplayer games and etc. With the introduction of Game Center, a framework built into the iOS SDK, developer can take advantage of all the features of Game Center built into the core of iOS SDK. Features such as: leaderboards, user authentication, achievements, multiplayer games and etc. Game Center is a quite new framework to iOS.
About the Author
Vandad Nahavandipoor is currently an iOS programmer for a leading digital media distributor in London, United Kingdom. He has led an international team of more than 30 iOS developers in his previous job. Some of the projects he has lead include the NatWest and the RBS iOS apps running on millions of iPhones and iPads in the UK. Vandad received his B.Sc and M.Sc in Information Technology for E-Commerce from the University of Sussex in England.
Vandad's programming experience started when he first learned Basic on his father's Commodore 64. He then took this experience and applied it on his uncle's Intel 186 computer, running Basic on DOS. At this point, he found programming for personal computers exciting indeed and moved on to learn Object Pascal. This allowed him to learn Borland Delphi quite easily. He wrote a short 400 pages book on Borland Delphi and dedicated the book to Borland. From then, he picked up x86 Assembly programming and wrote a hobby 32-bit operating system named Vandior. It wasn't until late 2007 when iOS programming became his main focus.
Aside from programming, Vandad is a road cyclist, enjoying friendly competition in cyclosportive events in England and traveling long distance on his bicycle to other European countries every now and then. He also enjoys tinkering with his piano and playing electric guitar. Some of his electric guitar performances are available on YouTube.
Table of Contents
Preface; Conventions Used in This Book; Using Code Examples; Safari® Books Online; How to Contact Us; Acknowledgments; Chapter 1: Game Center; 1.1 Introducing GCD and Block Objects; 1.2 Creating Game Center Accounts; 1.3 Setting Up Game Center for an iOS App; 1.4 Adding the Game Kit Framework; 1.5 Authenticating the Local Player in Game Center; 1.6 Retrieving the Local Player's Information; 1.7 Adding Friends in Game Center; 1.8 Retrieving the Local Player's Friends Information; 1.9 Creating Leaderboards in iTunes Connect; 1.10 Reporting Scores to Leaderboards; 1.11 Retrieving Leaderboards Information Programmatically; 1.12 Displaying Leaderboards to Players; 1.13 Creating Achievements in iTunes Connect; 1.14 Reporting Achievements to Game Center; 1.15 Retrieving Achievements Information Programmatically; 1.16 Displaying Achievements to Players; 1.17 Supporting Multiplayer Games and Matchmaking; 1.18 Handling Players' State Changes in Multiplayer Games;