Skip to content

A plugin to integrate Game Center in a Phonegap iOS app/game.

License

Notifications You must be signed in to change notification settings

NeatNait/cordova-plugin-gamecenter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-gamecenter

Install

With Cordova CLI:

cordova plugin add https://github.com/Wizcorp/cordova-plugin-gamecenter

Sample Code

Authentication

gameCenter.authenticate(Function success, Function failure);

Showing the leaderboard

gameCenter.showLeaderboard(String category, Function success, Function failure);

Showing the Achievements board

gameCenter.showAchievements(Function success, Function failure);

Getting view show/hide events

window.gameCenter.onshow = function() { console.log("onshow!" )}

window.gameCenter.onhide = function() { console.log("onhide!" )}

Report a score

gameCenter.reportScore(String category, int score, Function success, Function failure);

Report an achievement

gameCenter.reportAchievement(String category, Function success, Function failure);

** For a working example see the project in platforms/ios/ folder (remember to change your bundleId). **

FAQ

I don't see my Leaderboard / Achievements in the popup!

Check you have configured your bundle id corectly.

About

A plugin to integrate Game Center in a Phonegap iOS app/game.

PhoneGap plugin for manipulating native splash

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 80.8%
  • Shell 9.2%
  • HTML 4.9%
  • CSS 2.8%
  • JavaScript 1.9%
  • C 0.4%