Achievements
RGNCoreBuilder.AddModule(new
AchievementsModule());
AchievementsModule module = RGNCoreBuilder.I.GetModule<AchievementsModule>();
GetAchievementsResponseData responseData = await module.Get();
Return GetAchievementsResponseData object, which contains following fields:
- List<RGNAchievementDataV2> achievements - list of achievements correspond current application
Details of RGNAchievementDataV2:
- achievementId (string) - unique identifier of achievement
- name (string) - name of achievement
- description (string) - description of achievement
- virtualGoodReward (string) - virtual item which will be added to user inventory after achievement trigger, field should equal to virtual item id
- currencyRewards (List<RGNCurrency>) - currencies which will be added to user after achievement trigger
- repeatable (bool) - indicates whether the achievement can be completed multiple times
In order to complete an achievement, it requires to call the following function by passing achievement's unique id (string) as a parameter.
AchievementsModule module = RGNCoreBuilder.I.GetModule<AchievementsModule>();
TriggerAchievementResponseData response = await module.Trigger(achievementId);
Return TriggerAchievementResponseData object, which contains following fields:
- int status - request error code, if request success equals to 200
- string message - request error description, if request success equals to "ok"
Last modified 8mo ago