1.0.1 ā€¢ Published 8 months ago

@openforge/capacitor-apple-game-center v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

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 VersionSupport 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:

MaintainerGithub
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

  1. Click on Target App in xcode
  2. Add team to Signing and Capabilities
  3. Add Game Center Capability
  4. Go to your Apps in https://appstoreconnect.apple.com/ and add your application
  5. Scroll down in your App Store tab from your application view and check the Game Center field
  6. Go to Services tab and configure both Leaderboards and Achievements
  7. Go back to App Store tab and select you Leaderboards and Achievements configurations

API

signIn()

signIn() => Promise<void>
  • Method to sign-in a user

showLeaderboard(...)

showLeaderboard(options: { leaderboardID: string; }) => Promise<void>
  • Method to display the Leaderboards
ParamType
options{ leaderboardID: string; }

submitScore(...)

submitScore(options: { leaderboardID: string; totalScoreAmount: number; }) => Promise<void>
  • Method to submit a score to the Google Play Services SDK
ParamType
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
ParamType
options{ achievementID: string; }

incrementAchievementProgress(...)

incrementAchievementProgress(options: { achievementID: string; pointsToIncrement: number; }) => Promise<void>
  • Method to increment the progress of an achievement
ParamType
options{ achievementID: string; pointsToIncrement: number; }