1.0.1 ā¢ Published 8 months ago
@openforge/capacitor-apple-game-center v1.0.1
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; } |
1.0.1
8 months ago