Type Library Revision 2017.3060 Keywords Google Play Games Services, game network, gpgs Platforms Android, iOS
The Google Play Games Services plugin enables access to
This plugin is "plugin.gpgs"
. In addition, you must specify your googlePlayGamesAppId
within the android
table. Please see Project Settings below for details.
If you want to upgrade to this new plugin, you should remove the legacy plugin from build.settings
. Although this new plugin is build.settings
file.
To use this plugin, you must implement Google app licensing as outlined here and sign the .apk
with a private key as outlined here.
Some features/aspects are only available on Android — these will be specified
This plugin is currently in beta. APIs and project configuration are subject to change without notice during this time.
This plugin is currently available for Android and iOS, but multiplayer for iOS is still in development.
local gpgs = require( "plugin.gpgs" )
These core functions manage connection to Google's servers, authentication, and other tasks.
Specific functionality aspects of this plugin are divided into nodes for better organization:
To use this plugin, add an entry into the plugins
table of build.settings
. When added, the build server will integrate the plugin during the build phase.
settings = { plugins = { ["plugin.gpgs"] = { publisherId = "com.coronalabs" }, }, }
If your app is for Android, you must also specify the android
table of build.settings
as the googlePlayGamesAppId
key:
settings = { android = { googlePlayGamesAppId = "YOUR_APPLICATION_ID", }, }
If your app is for iOS, you must also include various details within build.settings
to ensure that
settings = { iphone = { plist = { GooglePlayGamesOAuth2ClientId = "YOUR_OAUTH2_CLIENT_ID", CFBundleURLTypes = { { CFBundleURLSchemes = { "YOUR_OAUTH2_CLIENT_ID_REVERSED" } }, { CFBundleURLSchemes = { "YOUR_IOS_APP_BUNDLE_ID" } }, }, } }, }
Notice that there are several critical parts which must be specified:
GooglePlayGamesOAuth2ClientId
— This key's value should be set to the CFBundleURLTypes
— The CFBundleURLTypes
table should include two URL scheme tables, as follows:
The first of these should contain the GooglePlayGamesOAuth2ClientId
value — for example, if your GooglePlayGamesOAuth2ClientId
is 760035641580-8eho8p557gtaaa7alouh5a2qlhtruomq.apps.googleusercontent.com
com.googleusercontent.apps.760035641580-8eho8p557gtaaa7alouh5a2qlhtruomq
The second of these should contain the Bundle ID of your iOS app as gathered from the Apple Developer portal, for example com.domainname.myapp
.