#import <CPTAuthenticatedConnection.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
-
◆ claimReward:()
Claim reward synchronous
- Parameters
-
badge | the badge with the reward to claim. (Must be a badge with a reward.) |
- Returns
- id<CPTClaimResponse>
◆ claimReward:andReward:()
Claim reward synchronous
- Parameters
-
badge | the badge with the reward to claim. (Must be a badge with a reward.) |
reward | Bage obejct |
- Returns
- id<CPTClaimResponse>
◆ claimRewardAsync:andReward:withCallback:()
- (void) claimRewardAsync: |
|
(nonnull id< CPTBadge >) |
badge |
andReward: |
|
(nonnull id< CPTReward >) |
reward |
withCallback: |
|
(RESPONSE_CALLBACK(id< CPTClaimResponse >)) |
callback |
|
|
| |
Claim a reward from a Badge with reward (has its hasReward() function returns true). Once a reward is claimed, it cannot be claimed again (will result in a callback error) callback will contain the claimed reward (you can use callback.getRewards() function).
This method is asynchronous.
- Parameters
-
badge | badge with reward to be claimed |
reward | reward to be claimed |
callback | response listener |
◆ claimRewardAsync:withCallback:()
- (void) claimRewardAsync: |
|
(nonnull id< CPTBadge >) |
badge |
withCallback: |
|
(RESPONSE_CALLBACK(id< CPTClaimResponse >)) |
callback |
|
|
| |
Claim a reward from a Badge with reward (has its hasReward() function returns true). Once a reward is claimed, it cannot be claimed again (will result in a callback error) callback will contain the claimed reward (you can use callback.getRewards() function).
This method is asynchronous.
- Parameters
-
badge | badge with reward to be claimed |
callback | response listener |
◆ createAction:callback:()
Creates a new action and adds it to your app. When you create new actions, several things happen:
-
The user the action is associated with, and other users, may receive points from doing this action, based on the action settings.
-
The user may get promoted to a new level because of the points he or she received from the action.
-
The user might achieve a badges, or multiple badges.
-
When one of these things happen, it will be reported in the response.
- Parameters
-
action | the action to create. The action can be obtained using ActionBuilder. |
callback | a callback that will contain the response and any exception that might have risen during the execution. The response may contain an erro code or the changes objects from the operation. |
◆ deleteNotificationOfType:query:messageID:()
- (nonnull id<CPTActionsResponse>) deleteNotificationOfType: |
|
(CPTActionType) |
actionType |
query: |
|
(nonnull id< CPTQuery >) |
query |
messageID: |
|
(nonnull NSString *) |
messageID |
|
|
| |
Removes a specific notification of the specified type (private or inbox) – either all notifications, or only a specified number.
- Parameters
-
actionType | the requested notification's type. They only allowed values are ActionType#PRIVATE and ActionType#INBOX - it is not possible to delete only the public notifications. Private notifications also include the public ones. |
query | query parameters. To create a query object use QueryBuilder |
messageID | the ID of the notification to delete Action#getID() |
- Returns
- a response object that may either contain an error code or the list of remaining notifications of the given type.
- Exceptions
-
CaptainUpException | |
IllegalArgumentException | if the actionType is PUBLIC |
◆ deleteNotificationOfTypeAsync:query:messageID:callback:()
- (void) deleteNotificationOfTypeAsync: |
|
(CPTActionType) |
actionType |
query: |
|
(nonnull id< CPTQuery >) |
query |
messageID: |
|
(nonnull NSString *) |
messageID |
callback: |
|
(RESPONSE_CALLBACK(id< CPTActionsResponse >)) |
callback |
|
|
| |
Removes a specific notification of the specified type (private or inbox) – either all notifications, or only a specified number. This method is preferred over deleteNotifications(ActionType, Query) since this will not block the current thread until the request returns.
- Parameters
-
actionType | the requested notification's type. They only allowed values are ActionType#PRIVATE and ActionType#INBOX - it is not possible to delete only the public notifications. Private notifications also include the public ones. |
query | query parameters. To create a query object use QueryBuilder |
messageID | the ID of the notification to delete Action#getID() |
callback | a callback that will contain the response and any exception that might have risen during the execution. |
◆ deleteNotificationsOfType:query:callback:()
- (void) deleteNotificationsOfType: |
|
(CPTActionType) |
actionType |
query: |
|
(nonnull id< CPTQuery >) |
query |
callback: |
|
(RESPONSE_CALLBACK(id< CPTActionsResponse >)) |
callback |
|
|
| |
Removes notifications of the specified type (private or inbox) – either all notifications, or only a specified number.
- Parameters
-
actionType | the requested notification's type. They only allowed values are ActionType#PRIVATE and ActionType#INBOX - it is not possible to delete only the public notifications. Private notifications also include the public ones. |
query | query parameters. To create a query object use QueryBuilder |
callback | |
◆ queryActionsOfType:query:callback:()
- (void) queryActionsOfType: |
|
(CPTActionType) |
actionType |
query: |
|
(nonnull id< CPTQuery >) |
query |
callback: |
|
(RESPONSE_CALLBACK(id< CPTActionsResponse >)) |
callback |
|
|
| |
Returns several actions and information about the users associated with them. Can return any type of actions for the authenticated user.
- Parameters
-
actionType | the type of the action |
query | query parameters. To create a query object use QueryBuilder |
callback | a callback that will contain the response and any exception that might have risen during the execution. |
- See also
- #queryActions(ActionType, Query)
◆ queryUnreadInboxWithCallback:()
- (void) queryUnreadInboxWithCallback: |
|
(RESPONSE_CALLBACK(id< CPTActionsResponse >)) |
callback |
|
Retrieves the unread inbox notification items
- Parameters
-
callback | List of unread inbox items |
◆ setListener:()
Used to listen to notification events from actions (used by framework
- Parameters
-
The documentation for this protocol was generated from the following file: