Play Games Services

Native API for Play Games Services.

Summary

Typedefs

PgsAchievementsClient typedef
An opaque handle to the Achievements Client.
PgsGamesSignInClient typedef
An opaque handle to the GamesSignIn Client.
PgsRecallClient typedef
An opaque handle to the Recall Client.

Functions

PgsAchievementsClient_create(jobject activity)
Creates a new Achievements Client instance.
PgsAchievementsClient_destroy(PgsAchievementsClient *achievements_client)
void
Destroys an Achievements Client instance.
PgsGamesSignInClient_create(jobject activity)
Creates a new GamesSignIn Client instance.
PgsGamesSignInClient_destroy(PgsGamesSignInClient *games_sign_in_client)
void
Destroys a GamesSignIn Client instance.
PgsRecallClient_create(jobject activity)
Creates a new Recall Client instance.
PgsRecallClient_destroy(PgsRecallClient *recall_client)
void
Destroys a Recall Client instance.
Pgs_destroy()
void
Shuts down the Play Games Services native SDK.
Pgs_initialize(JavaVM *vm, jobject context)
jint
Initializes the Play Games Services native SDK.

Typedefs

PgsAchievementsClient

struct PgsAchievementsClient PgsAchievementsClient

An opaque handle to the Achievements Client.

PgsGamesSignInClient

struct PgsGamesSignInClient PgsGamesSignInClient

An opaque handle to the GamesSignIn Client.

PgsRecallClient

struct PgsRecallClient PgsRecallClient

An opaque handle to the Recall Client.

Functions

PgsAchievementsClient_create

PgsAchievementsClient * PgsAchievementsClient_create(
  jobject activity
)

Creates a new Achievements Client instance.

This function creates a client handle for interacting with the achievements API.

Details
Parameters
activity
A JNI reference to a valid Android Activity.
Returns
A new PgsAchievementsClient handle, or NULL on failure. This handle must be released with PgsAchievementsClient_destroy().

PgsAchievementsClient_destroy

void PgsAchievementsClient_destroy(
  PgsAchievementsClient *achievements_client
)

Destroys an Achievements Client instance.

This function releases all resources associated with the client handle. The handle becomes invalid after this call.

Details
Parameters
achievements_client
The client handle to destroy.

PgsGamesSignInClient_create

PgsGamesSignInClient * PgsGamesSignInClient_create(
  jobject activity
)

Creates a new GamesSignIn Client instance.

This function creates a client handle for interacting with the GamesSignIn API.

Details
Parameters
activity
A JNI reference to a valid Android Activity.
Returns
A new PgsGamesSignInClient handle, or NULL on failure. This handle must be released with PgsGamesSignInClient_destroy().

PgsGamesSignInClient_destroy

void PgsGamesSignInClient_destroy(
  PgsGamesSignInClient *games_sign_in_client
)

Destroys a GamesSignIn Client instance.

This function releases all resources associated with the client handle. The handle becomes invalid after this call.

Details
Parameters
games_sign_in_client
The client handle to destroy.

PgsRecallClient_create

PgsRecallClient * PgsRecallClient_create(
  jobject activity
)

Creates a new Recall Client instance.

Details
Parameters
activity
A JNI reference to a valid Android Activity.
Returns
A new PgsRecallClient handle, or NULL on failure. This handle must be released with PgsRecallClient_destroy().

PgsRecallClient_destroy

void PgsRecallClient_destroy(
  PgsRecallClient *recall_client
)

Destroys a Recall Client instance.

Details
Parameters
recall_client
The client handle to destroy.

Pgs_destroy

void Pgs_destroy()

Shuts down the Play Games Services native SDK.

This should be called once when the application is closing to clean up all global references.

Pgs_initialize

jint Pgs_initialize(
  JavaVM *vm,
  jobject context
)

Initializes the Play Games Services native SDK.

This must be called once at application startup before any other SDK functions.

Details
Parameters
vm
The JavaVM pointer obtained.
context
An Android Activity object.
Returns
JNI_OK on success, or JNI_ERR on failure.