Official Website | Opportunities | Facebook
Working with the latest technologies, designing the best products, and sharing our knowledge with the world wide community.
- Google Developer Account
- Apple Developer Account
- Go to Google Play Console.
- Click New Game button and fill out name and category fields.
- Click Linked apps tab in side menu, and click the Android button.
- Enter your appId, should be found in your capacitor.config.json file.
- Click Save and Continue, then click "authorize your app now" button.
- Enter your sha-1 and confirm
- In your native android project, add your app id string to your strings xml file.
- your strings xml file can be found in android/app/src/main/res/values/strings.xml
- Go to testing tab and add test account.
- Add the plugin to main activity after running npx cap sync
- 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
- go to features, add leaderboard matching the generated id from google
When adding resouces to Google and Apple services, we would recommend you add resources to Google's Play Services first, and reuse the id values generated for resources in Apple's Game Center service. That way you wont need two sets of resource id's.
In order to use the plugin, you need to follow this steps:
- Include this meta data tags in the main manifest
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
- Add on build gradle (app):
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-games:19.0.0'
- On the Main Activy add:
import io.openforge.gameservices.GameServices;
...
add(GameServices.class);
...
Once all this steps are done, you just need to call the sign method of the plugin.
import { Plugins } from '@capacitor/core';
const { GameServices } = Plugins;
const data = await GameServices.signIn();