Unlocking an achievement
After your achievements are configured via Partner Center and published to your development sandbox, your title can unlock them by calling the XblAchievementsUpdateAchievementAsync API. For more information, see the example code in the next section. To unlock an achievement, setpercentComplete to 100.
If the user is online, the request is immediately sent to the XBOX services Achievements service and triggers the following user experiences.
- The user receives an Achievement Unlocked notification.
- The specified achievement appears as unlocked in the user’s achievement list for the title.
- The unlocked achievement is added to the user’s activity feed.
The user experience is visually the same for achievements that use either event-based Achievements or title-managed Achievements.
Updating completion progress for an achievement
To update a user’s progress toward unlocking an achievement, call XblAchievementsUpdateAchievementAsync. Set thepercentComplete argument to a whole number between 1-100.
For more information, see the following example code.
An achievement’s progress can only increase.
If percentComplete is set to a number less than the achievement’s last percentComplete value, the update is ignored.
For example, if the achievement’s percentComplete had previously been set to 75, sending an update with a value of 25 is ignored. The achievement is still displayed as 75 percent complete.
If percentComplete is set to 100, the achievement is unlocked.
If percentComplete is set to a number greater than 100, the API behaves as if you set the number to exactly 100.
Updating achievements for the current title
You can update achievements for the current title by calling XblAchievementsUpdateAchievementAsync, as follows. Flat C APIUpdating achievements for a different title
You can update achievements for anothertitleId by using XblAchievementsUpdateAchievementForTitleIdAsync, as follows.
Flat C API
