Skip to content

A capacitor plugin to connect to both Apple Game Center and Google Play Game Services libraries.

Notifications You must be signed in to change notification settings

openforge/capacitor-apple-game-center

 
 

Repository files navigation

Official Website | Opportunities | Mobile Academy

Leading By Example.

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

  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
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; }

About

A capacitor plugin to connect to both Apple Game Center and Google Play Game Services libraries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 57.6%
  • TypeScript 23.7%
  • Objective-C 7.9%
  • Ruby 7.2%
  • JavaScript 3.6%