Captainup  2.4
Instance Methods | List of all members
<CPTAuthenticatedConnection> Protocol Reference

#import <CPTAuthenticatedConnection.h>

Inheritance diagram for <CPTAuthenticatedConnection>:
<CPTConnection>

Instance Methods

(void) - createAction:callback:
 
(void) - queryActionsOfType:query:callback:
 
(void) - queryUnreadInboxWithCallback:
 
(void) - deleteNotificationsOfType:query:callback:
 
(nonnull id< CPTActionsResponse >) - deleteNotificationOfType:query:messageID:
 
(void) - deleteNotificationOfTypeAsync:query:messageID:callback:
 
(nonnull id< CPTClaimResponse >) - claimReward:
 
(nonnull id< CPTClaimResponse >) - claimReward:andReward:
 
(void) - claimRewardAsync:withCallback:
 
(void) - claimRewardAsync:andReward:withCallback:
 
(nonnull id< CPTCreateAcquireResponse >) - acquireAsset:
 
(void) - acquireAssetAsync:withCallback:
 
(void) - setListener:
 
- Instance Methods inherited from <CPTConnection>
(void) - retrieveApplication:
 
(void) - addOrUpdateIntegrationUser:callback:
 
(void) - queryActionsForPlayer:query:callback:
 
(void) - queryLeaderboard:forPlayer:withQuery:callback:
 
(void) - querySocialFeed:callback:
 
(void) - retrieveUser:callback:
 
(nonnull id< CPTAuthenticatedConnection >) - authenticate:
 
(void) - setLanguageCode:
 
(void) - setCountry:
 
(void) - setCurrency:
 
(void) - keepSocketConnected
 
(void) - disconnectSocket
 

Detailed Description

Description

Method Documentation

◆ acquireAsset:()

- (nonnull id<CPTCreateAcquireResponse>) acquireAsset: (nonnull id< CPTAsset >)  asset

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
assetThe id<CPTAsset> to acquire
Returns
CPTCreateAcquireResponse

◆ acquireAssetAsync:withCallback:()

- (void) acquireAssetAsync: (nonnull id< CPTAsset >)  asset
withCallback: (RESPONSE_CALLBACK(id< CPTCreateAcquireResponse >))  callback 

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
assetid<CPTAsset> to acquire
callbackCPTCreateAcquireResponse

◆ claimReward:()

- (nonnull id<CPTClaimResponse>) claimReward: (nonnull id< CPTBadge >)  badge

Claim reward synchronous

Parameters
badgethe badge with the reward to claim. (Must be a badge with a reward.)
Returns
id<CPTClaimResponse>

◆ claimReward:andReward:()

- (nonnull id<CPTClaimResponse>) claimReward: (nonnull id< CPTBadge >)  badge
andReward: (nonnull id< CPTReward >)  reward 

Claim reward synchronous

Parameters
badgethe badge with the reward to claim. (Must be a badge with a reward.)
rewardBage 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
badgebadge with reward to be claimed
rewardreward to be claimed
callbackresponse 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
badgebadge with reward to be claimed
callbackresponse listener

◆ createAction:callback:()

- (void) createAction: (nonnull id< CPTAction >)  action
callback: (RESPONSE_CALLBACK(id< CPTCreateActionResponse >))  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
actionthe action to create. The action can be obtained using ActionBuilder.
callbacka 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
actionTypethe 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.
queryquery parameters. To create a query object use QueryBuilder
messageIDthe 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
IllegalArgumentExceptionif 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
actionTypethe 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.
queryquery parameters. To create a query object use QueryBuilder
messageIDthe ID of the notification to delete Action#getID()
callbacka 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
actionTypethe 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.
queryquery 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
actionTypethe type of the action
queryquery parameters. To create a query object use QueryBuilder
callbacka 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
callbackList of unread inbox items

◆ setListener:()

- (void) setListener: (nonnull id< CPTSocketNotificationListener >)  listener

Used to listen to notification events from actions (used by framework

Parameters
listenerCPTSocketNotificationListener

The documentation for this protocol was generated from the following file: