GithubHelp home page GithubHelp logo

devcarlos / abgamekithelper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexblunck/abgamekithelper

5.0 2.0 4.0 131 KB

Objective-C Helper class to ease interaction with Apple's GameKit API (iOS8 Fixed)

License: MIT License

Objective-C 100.00%

abgamekithelper's Introduction

ABGameKitHelper (iOS8 Fixed!)

Fixed for iOS7/8 Objective-C Helper class to ease interaction with Apple's GameKit API with New iOS8 delegate GKGameCenterControllerDelegate!

Should work with all types of Apps for iOS7 and iOS8 and Cocos2D 2.x and 3.x

Features:

  • iOS7/8 Fixed
  • 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 ;)

ARC:

ABGameKitHelper uses ARC, to use it in a non ARC project be sure to add "-fobjc-arc" flag in "Compile Sources" configuration:

Targets->Build Phases->Compile Sources->ABGameKitHelper.m


Tutorial:

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

  1. Link "GameKit.framework", "CFNetwork.framework", "Security.framework" and "SystemConfiguration.framework" with your Project

  2. In ABGameKitHelper.h edit SECRET_KEY to your liking

  3. Call following code once the UI of your application is loaded

    [ABGameKitHelper sharedHelper];

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

Show Leaderboard

[[ABGameKitHelper sharedHelper] showLeaderboard:@"leaderboardId"];

Show Achievements

[[ABGameKitHelper sharedHelper] showAchievements];

Report Achievement

[[ABGameKitHelper sharedHelper] reportAchievement:@"achievementId" percentComplete:100.0f];

Show Notification (Shown only once per completed Achievement)

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

Report Leaderboard Score

[[ABGameKitHelper sharedHelper] 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


License:

MIT License, check "LICENSE"

abgamekithelper's People

Contributors

devcarlos avatar pmoebius avatar robbestad avatar rolyrolls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.