Play Games Services Sign-In

Native API for Play Games Services Sign-In.

Summary

Typedefs

PgsGamesSignInClient_IsAuthenticatedCallback)(PgsStatusCode status_code, bool is_authenticated, void *user_data) typedef
void(*
Callback for PgsGamesSignInClient_isAuthenticated.
PgsGamesSignInClient_RequestServerSideAccessCallback)(PgsStatusCode status_code, const char *auth_code, void *user_data) typedef
void(*
Callback for PgsGamesSignInClient_requestServerSideAccess.
PgsGamesSignInClient_RequestServerSideAccessWithScopesCallback)(PgsStatusCode status_code, const char *auth_code, PgsAuthScope *granted_scopes, int32_t granted_scopes_count, void *user_data) typedef
void(*
Callback for PgsGamesSignInClient_requestServerSideAccessWithScopes.
PgsGamesSignInClient_SignInCallback)(PgsStatusCode status_code, bool is_authenticated, void *user_data) typedef
void(*
Callback for PgsGamesSignInClient_signIn.

Functions

PgsGamesSignInClient_isAuthenticated(PgsGamesSignInClient *client, PgsGamesSignInClient_IsAuthenticatedCallback callback, void *user_data)
void
Checks if the player is currently authenticated with Play Games Services.
PgsGamesSignInClient_requestServerSideAccess(PgsGamesSignInClient *client, const char *server_client_id, bool force_refresh_token, PgsGamesSignInClient_RequestServerSideAccessCallback callback, void *user_data)
void
Retrieves the OAuth 2.0 server-side access code for the client ID specified in the Google Play Console.
PgsGamesSignInClient_requestServerSideAccessWithScopes(PgsGamesSignInClient *client, const char *server_client_id, bool force_refresh_token, const PgsAuthScope *scopes, int32_t scopes_count, PgsGamesSignInClient_RequestServerSideAccessWithScopesCallback callback, void *user_data)
void
Retrieves the OAuth 2.0 server-side access code for the client ID specified in the Google Play Console, with additional OAuth scopes.
PgsGamesSignInClient_signIn(PgsGamesSignInClient *client, PgsGamesSignInClient_SignInCallback callback, void *user_data)
void
Manually requests that your game sign in with Play Games Services.

Typedefs

PgsGamesSignInClient_IsAuthenticatedCallback

void(* PgsGamesSignInClient_IsAuthenticatedCallback)(PgsStatusCode status_code, bool is_authenticated, void *user_data)

Callback for PgsGamesSignInClient_isAuthenticated.

Details
Parameters
status_code
Result of the operation. PGS_STATUS_SUCCESS on success.
is_authenticated
True if the player is currently authenticated, false otherwise.
user_data
Pointer to the user-provided data passed in the original call.

PgsGamesSignInClient_RequestServerSideAccessCallback

void(* PgsGamesSignInClient_RequestServerSideAccessCallback)(PgsStatusCode status_code, const char *auth_code, void *user_data)

Callback for PgsGamesSignInClient_requestServerSideAccess.

Details
Parameters
status_code
Result of the operation. PGS_STATUS_SUCCESS on success.
auth_code
The server auth code if successful, otherwise NULL. The caller is responsible for managing the memory of this string if needed beyond the callback.
user_data
Pointer to the user-provided data passed in the original call.

PgsGamesSignInClient_RequestServerSideAccessWithScopesCallback

void(* PgsGamesSignInClient_RequestServerSideAccessWithScopesCallback)(PgsStatusCode status_code, const char *auth_code, PgsAuthScope *granted_scopes, int32_t granted_scopes_count, void *user_data)

Callback for PgsGamesSignInClient_requestServerSideAccessWithScopes.

Details
Parameters
status_code
Result of the operation. PGS_STATUS_SUCCESS on success.
auth_code
The server auth code if successful, otherwise NULL. The caller is responsible for managing the memory of this string if needed beyond the callback.
granted_scopes
The granted scopes if successful, otherwise NULL. The caller is responsible for managing the memory of this array if needed beyond the callback.
granted_scopes_count
The number of scopes in the granted_scopes array.
user_data
Pointer to the user-provided data passed in the original call.

PgsGamesSignInClient_SignInCallback

void(* PgsGamesSignInClient_SignInCallback)(PgsStatusCode status_code, bool is_authenticated, void *user_data)

Callback for PgsGamesSignInClient_signIn.

Details
Parameters
status_code
Result of the sign-in operation. PGS_STATUS_SUCCESS on success.
is_authenticated
True if the player is now authenticated, false otherwise. This is the result from AuthenticationResult.isAuthenticated().
user_data
Pointer to the user-provided data passed in the original call.

Functions

PgsGamesSignInClient_isAuthenticated

void PgsGamesSignInClient_isAuthenticated(
  PgsGamesSignInClient *client,
  PgsGamesSignInClient_IsAuthenticatedCallback callback,
  void *user_data
)

Checks if the player is currently authenticated with Play Games Services.

The result is provided asynchronously via the callback.

Details
Parameters
client
The GamesSignInClient handle.
callback
Function to be called with the result.
user_data
Arbitrary data pointer to be passed back to the callback.

PgsGamesSignInClient_requestServerSideAccess

void PgsGamesSignInClient_requestServerSideAccess(
  PgsGamesSignInClient *client,
  const char *server_client_id,
  bool force_refresh_token,
  PgsGamesSignInClient_RequestServerSideAccessCallback callback,
  void *user_data
)

Retrieves the OAuth 2.0 server-side access code for the client ID specified in the Google Play Console.

Details
Parameters
client
The GamesSignInClient handle.
server_client_id
The server client ID.
force_refresh_token
Whether to force a refresh of the access token.
callback
Function to be called with the result.
user_data
Arbitrary data pointer to be passed back to the callback.

PgsGamesSignInClient_requestServerSideAccessWithScopes

void PgsGamesSignInClient_requestServerSideAccessWithScopes(
  PgsGamesSignInClient *client,
  const char *server_client_id,
  bool force_refresh_token,
  const PgsAuthScope *scopes,
  int32_t scopes_count,
  PgsGamesSignInClient_RequestServerSideAccessWithScopesCallback callback,
  void *user_data
)

Retrieves the OAuth 2.0 server-side access code for the client ID specified in the Google Play Console, with additional OAuth scopes.

Details
Parameters
client
The GamesSignInClient handle.
server_client_id
The server client ID.
force_refresh_token
Whether to force a refresh of the access token.
scopes
Array of PgsAuthScope values to request.
scopes_count
Number of scopes in scopes array.
callback
Function to be called with the result.
user_data
Arbitrary data pointer to be passed back to the callback.

PgsGamesSignInClient_signIn

void PgsGamesSignInClient_signIn(
  PgsGamesSignInClient *client,
  PgsGamesSignInClient_SignInCallback callback,
  void *user_data
)

Manually requests that your game sign in with Play Games Services.

Note that a sign-in attempt will be made automatically when your game starts. Games will only need to manually request to sign in if the automatic sign-in attempt failed.

The result, including whether the user is authenticated, is provided asynchronously via the callback.

Details
Parameters
client
The GamesSignInClient handle.
callback
Function to be called with the result.
user_data
Arbitrary data pointer to be passed back to the callback.