#import <CPTActionableUser.h>
◆ acquireAsset:()
Acquire an asset, you will receive the Asset object in the CPTUserListener
listener. in some cases (for example when user does not have enough currency or stock is limited) call will return an error, you can listen to error events to catch that error, or supply a callback. This method is asynchronous.
- Parameters
-
asset | The id<CPTAsset> to acquire |
- Returns
- CPTCreateAcquireResponse
◆ acquireAssetAsync:withCallback:()
Acquire an asset, you will receive the Asset object in the CPTUserListener
listener. in some cases (for example when user does not have enough currency or stock is limited) call will return an error. This method is asynchronous.
- Parameters
-
◆ addListener:()
Adds a listener to this user instance. The type of event of events being listened to is determined by the exact protocols implemented by the listener parameter.
- Parameters
-
◆ claimReward:()
- (void) claimReward: |
|
(nonnull id< CPTBadge >) |
badge |
|
Performs a claim action on a badge with reward.
- Parameters
-
◆ claimReward:andReward:()
Performs a claim action on a badge with reward.
- Parameters
-
◆ claimReward:andReward:withCallback:()
Perform an Async claim action on a specific reward, accepts callback.
- Parameters
-
badge | CPTBadge with the reward |
reward | CPTReward The reward to claim |
callback | void(^)(id<CPTClaimResponse> response, NSError *error) with reward |
◆ claimReward:withCallback:()
Performs an Async claim action on a badge with reward, accepts a callback.
- Parameters
-
badge | CPTBadge with reward |
callback | void(^)(id<CPTClaimResponse> response, NSError *error) with reward |
◆ getUnclaimedRewards()
Returns a list of rewards that are ready to be claimed (unclaimed rewards from achieved badges). You can present these reward to the user with a 'claim' button, when user pressed 'claim' you can use claimReward
to claim.
- Returns
- NSDictionary map of all reward that the user can claim (where key is the badge object and value is the associated reward), or an empty Map in case no rewards are available.
◆ getUnclaimedRewards:()
- (nonnull NSArray<id<CPTReward>>*) getUnclaimedRewards: |
|
(nonnull id< CPTBadge >) |
badge |
|
Giving a Badge object, returns a list of associated rewards that are ready to be claimed. Can be used when achieving a badge to get all the badge's associated rewards.
- Parameters
-
badge | CPTBadge to check rewards in. (Must be an achieved badge) |
- Returns
- NSArray list of badge rewards or an empty list if no rewards are available.
◆ isRewardClaimable:()
- (BOOL) isRewardClaimable: |
|
(nonnull id< CPTBadge >) |
badge |
|
Checks if the badge's reward is available to claim for the current user.
- Returns
- true if badge contains a reward, badge was achieved and reward was never claimed, or (in case of repeatable badges with rewards), if badge was achieved more times than reward was claimed, otherwise returns false.
◆ performAction:()
- (void) performAction: |
|
(nonnull id< CPTAction >) |
action |
|
Perform action
- Parameters
-
◆ removeListener:()
Remove listner
- Parameters
-
◆ updateImageUrl:()
- (void) updateImageUrl: |
|
(nonnull NSString *) |
url |
|
Update user Image url
- Parameters
-
◆ updateImageUrl:withCallback:()
Update user Image url
- Parameters
-
url | user profile url |
callback | user prfoile url updated callback |
◆ updateName:()
- (void) updateName: |
|
(nonnull NSString *) |
name |
|
Update user name
- Parameters
-
◆ updateName:withCallback:()
Update user name
- Parameters
-
name | user name |
callback | user details updated callback |
◆ inbox
◆ notificationsQueue
The documentation for this protocol was generated from the following file: