Play Games Services Achievements
Native API for Play Games Services Achievements.
Summary
Typedefs |
|
|---|---|
PgsAchievementsClient_IncrementImmediateCallback)(PgsStatusCode status_code, bool is_unlocked, void *user_data)
|
typedefvoid(*
Callback for PgsAchievementsClient_incrementImmediate. |
PgsAchievementsClient_LoadCallback)(PgsStatusCode status_code, PgsAchievement *achievements_array, size_t achievements_count, void *user_data)
|
typedefvoid(*
Callback for PgsAchievementsClient_load. |
PgsAchievementsClient_RevealImmediateCallback)(PgsStatusCode status_code, void *user_data)
|
typedefvoid(*
Callback for PgsAchievementsClient_revealImmediate. |
PgsAchievementsClient_SetStepsImmediateCallback)(PgsStatusCode status_code, bool is_unlocked, void *user_data)
|
typedefvoid(*
Callback for PgsAchievementsClient_setStepsImmediate. |
PgsAchievementsClient_ShowAchievementsUICallback)(PgsStatusCode status_code, bool success, void *user_data)
|
typedefvoid(*
Callback for PgsAchievementsClient_showAchievementsUI. |
PgsAchievementsClient_UnlockImmediateCallback)(PgsStatusCode status_code, void *user_data)
|
typedefvoid(*
Callback for PgsAchievementsClient_unlockImmediate. |
Functions |
|
|---|---|
PgsAchievementsClient_increment(PgsAchievementsClient *achievements_client, const char *achievement_id, int32_t num_steps)
|
void
Increments an achievement by the given number of steps.
|
PgsAchievementsClient_incrementImmediate(PgsAchievementsClient *achievements_client, const char *achievement_id, int32_t num_steps, PgsAchievementsClient_IncrementImmediateCallback callback, void *user_data)
|
void
Asynchronously increments an achievement by the given number of steps, invoking a callback upon completion.
|
PgsAchievementsClient_load(PgsAchievementsClient *achievements_client, bool force_reload, PgsAchievementsClient_LoadCallback callback, void *user_data)
|
void
Asynchronously loads achievement data for the currently signed-in player for this application, invoking a callback upon completion.
|
PgsAchievementsClient_reveal(PgsAchievementsClient *achievements_client, const char *achievement_id)
|
void
Reveals a hidden achievement to the currently signed-in player.
|
PgsAchievementsClient_revealImmediate(PgsAchievementsClient *achievements_client, const char *achievement_id, PgsAchievementsClient_RevealImmediateCallback callback, void *user_data)
|
void
Asynchronously reveals a hidden achievement to the currently signed-in player, invoking a callback upon completion.
|
PgsAchievementsClient_setSteps(PgsAchievementsClient *achievements_client, const char *achievement_id, int32_t num_steps)
|
void
Sets an achievement to have at least the given number of steps completed.
|
PgsAchievementsClient_setStepsImmediate(PgsAchievementsClient *achievements_client, const char *achievement_id, int32_t num_steps, PgsAchievementsClient_SetStepsImmediateCallback callback, void *user_data)
|
void
Asynchronously sets an achievement to have at least the given number of steps completed, invoking a callback upon completion.
|
PgsAchievementsClient_showAchievementsUI(PgsAchievementsClient *achievements_client, jobject activity, PgsAchievementsClient_ShowAchievementsUICallback callback, void *user_data)
|
void
Asynchronously loads and displays the standard achievements UI.
|
PgsAchievementsClient_unlock(PgsAchievementsClient *achievements_client, const char *achievement_id)
|
void
Unlocks an achievement for the currently signed-in player.
|
PgsAchievementsClient_unlockImmediate(PgsAchievementsClient *achievements_client, const char *achievement_id, PgsAchievementsClient_UnlockImmediateCallback callback, void *user_data)
|
void
Asynchronously unlocks an achievement for the currently signed-in player, invoking a callback upon completion.
|
Typedefs
PgsAchievementsClient_IncrementImmediateCallback
void(* PgsAchievementsClient_IncrementImmediateCallback)(PgsStatusCode status_code, bool is_unlocked, void *user_data)
Callback for PgsAchievementsClient_incrementImmediate.
This is invoked after the asynchronous operation to increment the achievement and update the server completes or fails.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_LoadCallback
void(* PgsAchievementsClient_LoadCallback)(PgsStatusCode status_code, PgsAchievement *achievements_array, size_t achievements_count, void *user_data)
Callback for PgsAchievementsClient_load.
This is invoked after the asynchronous operation to load achievements completes or fails.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_RevealImmediateCallback
void(* PgsAchievementsClient_RevealImmediateCallback)(PgsStatusCode status_code, void *user_data)
Callback for PgsAchievementsClient_revealImmediate.
This is invoked after the asynchronous operation to reveal the achievement and update the server completes or fails.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_SetStepsImmediateCallback
void(* PgsAchievementsClient_SetStepsImmediateCallback)(PgsStatusCode status_code, bool is_unlocked, void *user_data)
Callback for PgsAchievementsClient_setStepsImmediate.
This is invoked after the asynchronous operation to set the achievement steps and update the server completes or fails.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_ShowAchievementsUICallback
void(* PgsAchievementsClient_ShowAchievementsUICallback)(PgsStatusCode status_code, bool success, void *user_data)
Callback for PgsAchievementsClient_showAchievementsUI.
This is invoked after the attempt to load and display the UI.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_UnlockImmediateCallback
void(* PgsAchievementsClient_UnlockImmediateCallback)(PgsStatusCode status_code, void *user_data)
Callback for PgsAchievementsClient_unlockImmediate.
This is invoked after the asynchronous operation to unlock the achievement and update the server completes or fails.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
Functions
PgsAchievementsClient_increment
void PgsAchievementsClient_increment( PgsAchievementsClient *achievements_client, const char *achievement_id, int32_t num_steps )
Increments an achievement by the given number of steps.
The achievement must be an incremental achievement. Once an achievement reaches at least the maximum number of steps, it will be unlocked automatically. Any further increments will be ignored.
This is the fire-and-forget form of the API. Use this form if you don't need to know the status of the operation immediately. For most applications, this will be the preferred API to use, though note that the update may not be sent to the server until the next sync. See the "Immediate" version if you need the operation to attempt to communicate to the server immediately or need to have the status code delivered to your application.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_incrementImmediate
void PgsAchievementsClient_incrementImmediate( PgsAchievementsClient *achievements_client, const char *achievement_id, int32_t num_steps, PgsAchievementsClient_IncrementImmediateCallback callback, void *user_data )
Asynchronously increments an achievement by the given number of steps, invoking a callback upon completion.
The achievement must be an incremental achievement. Once an achievement reaches at least the maximum number of steps, it will be unlocked automatically. Any further increments will be ignored.
This form of the API will attempt to update the user's achievement on the server immediately. The callback is invoked with the status and a boolean indicating whether the achievement is now unlocked.
| Details | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_load
void PgsAchievementsClient_load( PgsAchievementsClient *achievements_client, bool force_reload, PgsAchievementsClient_LoadCallback callback, void *user_data )
Asynchronously loads achievement data for the currently signed-in player for this application, invoking a callback upon completion.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_reveal
void PgsAchievementsClient_reveal( PgsAchievementsClient *achievements_client, const char *achievement_id )
Reveals a hidden achievement to the currently signed-in player.
If the achievement has already been unlocked, this will have no effect.
This is the "fire-and-forget" form of the API. Use this form if you do not need to know the status of the operation immediately.
Note that the update may not be sent to the server until the next sync. See the "Immediate" version if you need the operation to attempt to communicate to the server immediately or need to have the status code delivered to your application.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_revealImmediate
void PgsAchievementsClient_revealImmediate( PgsAchievementsClient *achievements_client, const char *achievement_id, PgsAchievementsClient_RevealImmediateCallback callback, void *user_data )
Asynchronously reveals a hidden achievement to the currently signed-in player, invoking a callback upon completion.
If the achievement is already visible, this will have no effect.
This form of the API will attempt to update the user's achievement on the server immediately. The callback is invoked with the status when the server has been updated or the operation fails.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_setSteps
void PgsAchievementsClient_setSteps( PgsAchievementsClient *achievements_client, const char *achievement_id, int32_t num_steps )
Sets an achievement to have at least the given number of steps completed.
Calling this method while the achievement already has more steps than the provided value is a no-op. Once the achievement reaches the maximum number of steps, the achievement will automatically be unlocked, and any further mutation operations will be ignored.
This is the fire-and-forget form of the API. Use this form if you don't need to know the status of the operation immediately. For most applications, this will be the preferred API to use, though note that the update may not be sent to the server until the next sync. See the "Immediate" version if you need the operation to attempt to communicate to the server immediately or need to have the status code delivered to your application.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_setStepsImmediate
void PgsAchievementsClient_setStepsImmediate( PgsAchievementsClient *achievements_client, const char *achievement_id, int32_t num_steps, PgsAchievementsClient_SetStepsImmediateCallback callback, void *user_data )
Asynchronously sets an achievement to have at least the given number of steps completed, invoking a callback upon completion.
Calling this method while the achievement already has more steps than the provided value is a no-op. Once the achievement reaches the maximum number of steps, the achievement will automatically be unlocked, and any further mutation operations will be ignored.
This form of the API will attempt to update the user's achievement on the server immediately. The callback is invoked with the status and a boolean indicating whether the achievement is now unlocked.
| Details | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_showAchievementsUI
void PgsAchievementsClient_showAchievementsUI( PgsAchievementsClient *achievements_client, jobject activity, PgsAchievementsClient_ShowAchievementsUICallback callback, void *user_data )
Asynchronously loads and displays the standard achievements UI.
This function asynchronously loads the necessary components and then presents the achievements screen to the player.
The callback is invoked to report the success or failure of the operation to load and display the UI.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_unlock
void PgsAchievementsClient_unlock( PgsAchievementsClient *achievements_client, const char *achievement_id )
Unlocks an achievement for the currently signed-in player.
If the achievement is hidden, this will reveal it to the player.
This is the "fire-and-forget" form of the API. Use this form if you do not need to know the status of the operation immediately.
Note that the update may not be sent to the server until the next sync. If you need the operation to attempt to communicate to the server immediately or need to have the status code delivered, please use the "Immediate" version of this function.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
PgsAchievementsClient_unlockImmediate
void PgsAchievementsClient_unlockImmediate( PgsAchievementsClient *achievements_client, const char *achievement_id, PgsAchievementsClient_UnlockImmediateCallback callback, void *user_data )
Asynchronously unlocks an achievement for the currently signed-in player, invoking a callback upon completion.
If the achievement is hidden, this will reveal it to the player.
This form of the API will attempt to update the user's achievement on the server immediately. The callback is invoked with the status when the server has been updated or the operation fails.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|