Objective-C Helper class to ease interaction with Apple's GameKit API
Pull request Compare This branch is 21 commits behind alexblunck:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
ABGameKitHelper.h
ABGameKitHelper.m
NSData+AES256.h
NSData+AES256.m
README.md

README.md

ABGameKitHelper

Objective-C Helper class to ease interaction with Apple's GameKit API

Should work with all types of Apps, also Cocos2d 1 & 2+

Features:

  • Show Leaderboards (specify which) / Achievements
  • Report Scores to Leaderboards / Report Achievements
  • Achievement / Score Caching System
  • All saved data is encrypted (AppStore Safe) … no cheating here ;)

Tutorial:

Getting ABGameKitHelper up and running is fairly easy, here a step by step guide to get you started:

  1. Add "GameKit.framework" Library to your Project

  2. In ABGameKitHelper.m edit APPNAME and AESKEY to your liking

  3. In your AppDelegate's ..application didFinishLaunchingWithOptions… Method add following code to automatially authenticate player with GameCenter:

    [[ABGameKitHelper sharedClass] authenticatePlayer];

  4. Thats the basic setup, easy huh? Now on to actually interacting with GameCenter:

Show Leaderboard

[[ABGameKitHelper sharedClass] showLeaderboard:@"leaderboardID"];

Show Achievements

[[ABGameKitHelper sharedClass] showAchievements];

Report Achievement

[[ABGameKitHelper sharedClass] reportAchievement:@"achievementID" percentComplete:100];

Show Notification (Is only once per completed Achievement)

[[ABGameKitHelper sharedClass] showNotification:@"Notification Title" message:@"Some Message" identifier:@"achievementID"];

Report Leaderboard Score

[[ABGameKitHelper sharedClass] reportScore:2000 forLeaderboard:@"leaderboardID"];

! If no Internet connection is present during reporting Achievemnts/Leaderboard Scores are automatically cached and reported the next time the Player authenticates (The Code in the AppDelegate)


Future:

  • Mac / Moutain Lion Compatibility

License:

Copyright (c) 2012 Ablfx (Alexander Blunck)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.