public class SwarmAchievement
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
SwarmAchievement.AchievementUnlockedCB |
static class |
SwarmAchievement.GotAchievementsListCB |
static class |
SwarmAchievement.GotAchievementsMapCB |
Modifier and Type | Field and Description |
---|---|
java.lang.String |
description
The description that tells the user how to unlock this achievement.
|
boolean |
hidden
If true, this achievement is not visible to the user in the app's list of achievements until it is unlocked.
|
int |
id
This Swarm Achievement's unique integer identification number.
|
int |
orderId
Identifies this Swarm Achievement's position in the Swarm Achievement list.
|
int |
points
The number of Swarm Points that a user will earn by unlocking this achievement.
|
java.lang.String |
title
The title of this Swarm Achievement that is displayed to the user in the app's achievement list and in the Swarm Notification that is shown to the user when this achievement is unlocked.
|
Constructor and Description |
---|
SwarmAchievement()
The default empty constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
getAchievementsList(SwarmAchievement.GotAchievementsListCB cb)
Get the full list of Achievements for this app.
|
static void |
getAchievementsMap(SwarmAchievement.GotAchievementsMapCB cb)
Get a map of Achievements for this app.
|
void |
getUnlockDate(SwarmAchievement.AchievementUnlockedCB cb)
Get the date that the user unlocked this achievement.
|
static void |
isUnlocked(int achievementId,
SwarmAchievement.AchievementUnlockedCB cb)
Check to see if the specified Achievement is unlocked.
|
void |
isUnlocked(SwarmAchievement.AchievementUnlockedCB cb)
Check to see if this Achievement is unlocked.
|
void |
unlock()
Unlock the achievement and display a Swarm Notification to the user showing that this achievement was unlocked.
|
static void |
unlock(int achievementId)
Unlock the achievement specified by the achievementId.
|
static void |
unlock(int achievementId,
SwarmAchievement.AchievementUnlockedCB cb)
Unlock the achievement specified by the achievementId.
|
void |
unlock(SwarmAchievement.AchievementUnlockedCB cb)
Unlock the achievement and display a Swarm Notification to the user showing that this achievement was unlocked.
|
public int id
public int orderId
public java.lang.String title
public java.lang.String description
public int points
public boolean hidden
public SwarmAchievement()
public void getUnlockDate(SwarmAchievement.AchievementUnlockedCB cb)
public void unlock()
public void unlock(SwarmAchievement.AchievementUnlockedCB cb)
cb
- AchievementUnlockedCB callback returns true if this achievement was successfully unlocked and returns false otherwise. (null safe)public static void unlock(int achievementId)
achievementId
- The identification number of the achievement you wish to unlock.public static void unlock(int achievementId, SwarmAchievement.AchievementUnlockedCB cb)
achievementId
- The identification number of the achievement you wish to unlock.cb
- AchievementUnlockedCB callback returns true if this achievement was successfully unlocked by this method call, and returns false otherwise. (null safe)public void isUnlocked(SwarmAchievement.AchievementUnlockedCB cb)
cb
- GotUnlockedCB callback returns true if this Achievement is unlocked, returns false otherwise.public static void isUnlocked(int achievementId, SwarmAchievement.AchievementUnlockedCB cb)
achievementId
- The identification number of the achievement you wish to check.cb
- GotUnlockedCB callback returns true if this Achievement is unlocked, returns false otherwise.public static void getAchievementsList(SwarmAchievement.GotAchievementsListCB cb)
cb
- GotAchievementsListCB callback returns List<SwarmAchievement> if the request succeeded and returns null otherwise.public static void getAchievementsMap(SwarmAchievement.GotAchievementsMapCB cb)
cb
- GotAchievementsMapCB callback returns Map<Integer,SwarmAchievement> if the request succeeded and returns null otherwise.