@openforge/capacitor-apple-game-center
v1.0.1
Published
Use Apple Game Connect
Downloads
3
Readme
Introduction
Capacitor plugin for connecting and using services by Apple Game Center. Features included are access to Sign-In, Leaderboard, and Achievements.
If you need both Apple Game Center and Google Play Game Services, check out our other Capacitor plugin that contains both!
| Capacitor Version | Support Status | | ----------- | :----: | | Capacitor v5 | 🚧 | | Capacitor v4 | ✅ | | Capacitor v3 | ✅ | | Capacitor v2 | 🚧 | | Capacitor v1 | 🚧 |
✅ - Supported 🚧 - WIP Support ❌ - No plans to support
Maintainers
The lovely folks at OpenForge! Feel free to tag any of the following:
| Maintainer | Github | | ---------- | :----: | | Ricardo | @Ricardo385 | | Paulina | @paulpauldevelops | | Jedi | @jedihacks |
Example Projects
Checkout these existing Ionic/Angular/Capacitor mobile game with the plugin installed and integrated:
Getting Started
Install
npm install @openforge/capacitor-apple-game-center
npx cap sync
Setup for iOS
- Click on Target App in xcode
- Add team to Signing and Capabilities
- Add Game Center Capability
- Go to your Apps in https://appstoreconnect.apple.com/ and add your application
- Scroll down in your App Store tab from your application view and check the Game Center field
- Go to Services tab and configure both Leaderboards and Achievements
- Go back to App Store tab and select you Leaderboards and Achievements configurations
API
signIn()
showLeaderboard(...)
submitScore(...)
showAchievements()
unlockAchievement(...)
incrementAchievementProgress(...)
signIn()
signIn() => Promise<void>
- Method to sign-in a user
showLeaderboard(...)
showLeaderboard(options: { leaderboardID: string; }) => Promise<void>
- Method to display the Leaderboards
| Param | Type |
| ------------- | --------------------------------------- |
| options
| { leaderboardID: string; } |
submitScore(...)
submitScore(options: { leaderboardID: string; totalScoreAmount: number; }) => Promise<void>
- Method to submit a score to the Google Play Services SDK
| Param | Type |
| ------------- | ----------------------------------------------------------------- |
| options
| { leaderboardID: string; totalScoreAmount: number; } |
showAchievements()
showAchievements() => Promise<void>
- Method to display the Achievements view
unlockAchievement(...)
unlockAchievement(options: { achievementID: string; }) => Promise<void>
- Method to unlock an achievement
| Param | Type |
| ------------- | --------------------------------------- |
| options
| { achievementID: string; } |
incrementAchievementProgress(...)
incrementAchievementProgress(options: { achievementID: string; pointsToIncrement: number; }) => Promise<void>
- Method to increment the progress of an achievement
| Param | Type |
| ------------- | ------------------------------------------------------------------ |
| options
| { achievementID: string; pointsToIncrement: number; } |