Class AN_AchievementsClient
Inheritance
Namespace: SA.Android.GMS.Games
Assembly: cs.temp.dll.dll
Syntax
public class AN_AchievementsClient : AN_LinkedObject
Methods
GetAchievementsIntent(Action<AN_IntentResult>)
Returns a callback which asynchronously loads an AN_Intent to show the list of achievements for a game. Note that the AN_Intent returned from the callback must be invoked with startActivityForResult, so that the identity of the calling package can be established.
Declaration
public void GetAchievementsIntent(Action<AN_IntentResult> callback)
Parameters
Type | Name | Description |
---|---|---|
Action<AN_IntentResult> | callback | Callback. |
Increment(String, Int32)
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. Ask about incrementImmediate(String, int) if you need the operation to attempt to communicate to the server immediately or need to have the status code delivered to your application.
Required Scopes: SCOPE_GAMES_LITE
Declaration
public void Increment(string achievementId, int numSteps)
Parameters
Type | Name | Description |
---|---|---|
System.String | achievementId | The achievement ID to increment. |
System.Int32 | numSteps | The number of steps to increment by. Must be greater than 0. |
IncrementImmediate(String, Int32, Action<AN_AchievementIncrementResult>)
Asynchronously 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 form of the API will attempt to update the user's achievement on the server immediately. The result successful response indicates whether the achievement is now unlocked.
Declaration
public void IncrementImmediate(string achievementId, int numSteps, Action<AN_AchievementIncrementResult> callback)
Parameters
Type | Name | Description |
---|---|---|
System.String | achievementId | The ID of the achievement to increment. |
System.Int32 | numSteps | The number of steps to increment by. Must be greater than 0. |
Action<AN_AchievementIncrementResult> | callback | Result callback |
Load(Boolean, Action<AN_AchievementsLoadResult>)
Asynchronously loads an AN_AchievementsLoadResult that represents the achievement data for the currently signed-in player.
Required Scopes: SCOPE_GAMES_LITE
Declaration
public void Load(bool forceReload, Action<AN_AchievementsLoadResult> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | forceReload | If |
Action<AN_AchievementsLoadResult> | callback | Load callback. |
Reveal(String)
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 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. Ask about RevealImmediate(String, int) if you need the operation to attempt to communicate to the server immediately or need to have the status code delivered to your application.
Required Scopes: SCOPE_GAMES_LITE
Declaration
public void Reveal(string achievementId)
Parameters
Type | Name | Description |
---|---|---|
System.String | achievementId | The achievement ID to reveal. |
RevealImmediate(String, Action<SA_Result>)
Asynchronously reveals a hidden achievement to the currently signed in player. 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. If the Result callback is successful the server has been updated.
Declaration
public void RevealImmediate(string achievementId, Action<SA_Result> callback)
Parameters
Type | Name | Description |
---|---|---|
System.String | achievementId | The achievement ID to reveal. |
Action<SA_Result> | callback | Result callback |
Unlock(String)
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 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. Ask about RevealImmediate(String, int) if you need the operation to attempt to communicate to the server immediately or need to have the status code delivered to your application.
Required Scopes: SCOPE_GAMES_LITE
Declaration
public void Unlock(string achievementId)
Parameters
Type | Name | Description |
---|---|---|
System.String | achievementId | The achievement ID to unlock. |
UnlockImmediate(String, Action<SA_Result>)
Asynchronously unlocks an achievement for the currently signed in player. 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 will complete successfully when the server has been updated.
Declaration
public void UnlockImmediate(string achievementId, Action<SA_Result> callback)
Parameters
Type | Name | Description |
---|---|---|
System.String | achievementId | The achievement ID to unlock. |
Action<SA_Result> | callback | Result callback |