Google Play Games Services

Type Library
Revision Release 2022.3683
Keywords google, google play games services, achievements, leaderboards
Platforms Android
Sample https://github.com/coronalabs/gpgs.sample

Overview

This plugin enables access to Google Play Games Services API, such as achievements, leaderboards and snapshots(Saved Games).

If you encounter Google Play Games Services login issues/errors after implementing this plugin, ensure that you have enabled Google Play Developer API within the Google Play Developer Console.

Also in order to use snapshots you must add Drive API within the Google Play Developer Console.

Changes from GPGS V2 to V3

Changed Apis

gpgs.init()

Initialize is now required and will attempt to sign in the player automatically

gpgs.isConnected(listener)

isConnected is now async and has a callback. use isConnected to check if a player is automatically connected via init or manually login functions

gpgs.isAuthenticated()

isAuthenticated is actually the same but should be noted that isAuthenticated only applies for logins in via gpgs.login(). This is important for Snapshots which is needed to use gpgs.login() for requesting Drive API access.

gpgs.login()

There is a new useDrive param which is need for Snapshots. It is import to note that the Drive scope is not added by default and you must set the useDrive param to true.

No longer supported functions

gpgs.setPopupPosition()

gpgs.showSettings()

gpgs.loadGame()

gpgs.clearNotifications()

gpgs.videos.*

Revert back to gpgs.v2 to use these functions

Syntax

local gpgs= require( "plugin.gpgs.v3" )

Project Settings

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.v3"] = {
            publisherId = "com.solar2d",
        }
    }
}

Nodes

The plugin is divided into API nodes for better organization.

gpgs.*

Overview

This is the base API node for the plugin. It manages connection to the Google's servers, authentication and general SDK tasks.

Functions

Events

Types

Game