◆ getReward()
Get badge reward
- Returns
- return CPTRward object or null if badge do not have any reward
◆ hasReward()
if Badge object has any Reward
- Returns
- return is badge have reward or not
◆ isSegmentedForUser:()
- (BOOL) isSegmentedForUser: |
|
(nonnull id< CPTUser >) |
user |
|
Use this function to know if a badge should be displayed for your specific user For example: badge.isSegmentedForUser(CaptainUp.getLoggedInUser())
- Parameters
-
- Returns
- return Bool is segmemted for user or not
◆ badgeDescription
- (NSString*) badgeDescription |
|
readnonatomicassign |
◆ badgeId
◆ conditions
A list of all the badge conditions for achievment
◆ currencies
- (NSDictionary<NSString*,NSNumber*>*) currencies |
|
readnonatomicassign |
Get the currencies awarded when achieving this badge. For example: badge.getCurrencies().get("points") will return the amount of points awarded when completing the badge's conditions
- Returns
- A map where key is the currency name and value is the awarded currency amount
◆ customData
- (NSDictionary<NSString*,id>*) customData |
|
readnonatomicassign |
The badge's custom data. A dictionary between the key (always NSString) to the data (NSString, NSNumber or NSArray)
◆ imageFiles
Details on the badge's image files
- Returns
- the details of the badge's image files
◆ imageURL
A URL pointing to the badge's image.
◆ isActive
Whether the badge is active or not (in v1 - this will always be true)
◆ isHidden
Whether the badge is "hidden". Hidden badges are to be show as a secret badge in the UI.
◆ isSegmented
Segmented badges can be used to filter the badge presentation according to different user attributes. For example - you can add a "market" filter so only users in this specific market can see the badge.
If a badge is segmented, you can check if it is restricted for the current user by checking his unavailable segmented badges list (User#getUnavailableSegmentedBadgesIDs() - A badge that is both segmented and appears in the user restricted segmented badges list should not be shown to that user.
- Returns
- true if badge is segmented, false otherwise.
◆ isVisible
A badge that is not visible will be hidden from users that have not achieved it.
- Returns
- true if badge is visible
◆ name
◆ points
The number of points that will be awarded to the user for achieving this badge
◆ repeatable
A repeatable badge is a badge that can be achieved multiple times. you can check inside a player's badge progress to know how many times he achieved a badge For example:
CaptainUp.getLoggedInUser().getBadgeProgress().get(badge.getID()).getTimesCompleted()
- Returns
- true if a badge is repeatable, false otherwise.
◆ rewards
◆ weight
The badge weight affect the weight given to each badge when we sort, display and recommend the badges to users. The higher the weight, the more difficult the badge is considered the be, the lower the likelihood we recommend users to complete this badge.
The documentation for this protocol was generated from the following file: