#import <CPTConnection.h>
A connection to the Captain Up Platform. An instance of this interface should be instantiated using CaptainUpConnectionFactory#createConnection(String, String, String). Contains method that does not require authentication to be used (aside from the App ID and Mobile Token, that was used to create the connection).
◆ addOrUpdateIntegrationUser:callback:()
Allows you to either update an existing user account or create a new user account, based on a unique user ID that you create and maintain in your system. The response will contain the updated user information. thread until the request returns.
- Parameters
-
user | the user details to create or update. The user can be created using the IntegrationUserBuilder |
callback | a callback that will contain the response and any exception that might have risen during the execution. |
◆ authenticate:()
Returns an authenticated connection to captain up. Some operations are only available after authentication.
- Parameters
-
user | the user to authenticate. This user can be acquired from the addOrUpdateIntegrationUser. |
- Returns
- an authenticated connection to captain up.
- See also
- #addOrUpdateIntegrationUser(IntegrationUser)
-
#addOrUpdateIntegrationUserAsync(IntegrationUser, ResponseCallback)
◆ disconnectSocket()
- (void) disconnectSocket |
|
|
|
Call this method to disconnect socket.
◆ keepSocketConnected()
- (void) keepSocketConnected |
|
|
|
Call this method to keep socket connected. Main use would be connect immidialty whne applicaion becomes acrive
◆ queryActionsForPlayer:query:callback:()
- (void) queryActionsForPlayer: |
|
(nonnull NSString *) |
playerId |
query: |
|
(nonnull id< CPTQuery >) |
query |
callback: |
|
(RESPONSE_CALLBACK(id< CPTSocialFeedResponse >)) |
callback |
|
|
| |
Returns several actions and information about the users associated with them. Only returns public actions, since there is no authenticated user. Use this method to request the public actions of any user in your application. thread until the request returns.
- Parameters
-
playerId | the ID of the player whose actions are requested |
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. |
◆ queryLeaderboard:forPlayer:withQuery:callback:()
- (void) queryLeaderboard: |
|
(CPTLeaderboardTime) |
time |
forPlayer: |
|
(nullable NSString *) |
playerId |
withQuery: |
|
(nonnull id< CPTQuery >) |
query |
callback: |
|
(RESPONSE_CALLBACK(id< CPTLeaderboardResponse >)) |
callback |
|
|
| |
Returns several users from the requested leaderboard, including general information on t hose users, and their position in the leaderboard.
- Parameters
-
time | the type of the leaderboard (according to the time limit on the leaderboard) |
playerId | the user id for the user we want to focus the leaderboard on. Useful for showing a specific user’s standing in the leaderboard. If playerId is not null , the skip query parameter will be dismissed. The response will be a list of the players around the given player, with a maximum of half the users above the player and the rest below. |
query | query parameters. To create a query object use QueryBuilder.
-
skip - The number of users to skip when returning the users. If skip is above the total number of users, an empty list of users will be returned.
-
limit - The maximum number of users to return in the results. Can be between 10 and 100.
-
extended - If set to true, will return extended information on each user.
|
- Returns
- a response object that may either contain an error code or the leaderboard's details
◆ querySocialFeed:callback:()
Returns several actions and information about the users associated with them. Only returns public actions, since there is no authenticated user. Use this method to request the public actions of any user in your application. This method is preferred over queryActions
since this will not block the current thread until the request returns.
- Parameters
-
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. |
◆ retrieveApplication:()
Returns all the current connected application's settings, including information on the action settings, levels, badges and etc. current thread until the request returns.
- Parameters
-
callback | a callback that will contain the response and any exception that might have risen during the execution. |
◆ retrieveUser:callback:()
- (void) retrieveUser: |
|
(nonnull NSString *) |
userId |
callback: |
|
(RESPONSE_CALLBACK(id< CPTUserResponse >)) |
callback |
|
|
| |
Returns information about the specific user requested, including general information about the user (name, Facebook link, avatar, etc.) and information about the user's progress (current level, number of points, missions and progress).
- Parameters
-
userId | the user's captain-up ID |
callback | callback that will contain the response and any exception that might have risen during the execution. |
- See also
- #retrieveUser(String)
◆ setCountry:()
- (void) setCountry: |
|
(nonnull NSString *) |
country |
|
Use this function for setting your user country, setting country will affect your application currency conversion ratio. this function must be called *before calling
- See also
- authenticate(User user) or connect.
This function is used internally by CaptainUpManager object
- Parameters
-
country | country code string |
◆ setCurrency:()
- (void) setCurrency: |
|
(nonnull NSString *) |
currency |
|
Use this function for setting your user currency, setting currency will affect your application currency conversion ratio. this function must be called *before calling
- See also
- authenticate(User user) or connect.
This function is used internally by CaptainUpManager object
- Parameters
-
◆ setLanguageCode:()
- (void) setLanguageCode: |
|
(nonnull NSString *) |
languageCode |
|
Use this function for setting your user localization, setting language code will affect your application badges and levels as localized in the admins panel. this function must be called *before calling
- See also
- authenticate(User user) or connect.
This function is used internally by CaptainUpManager object
- Parameters
-
languageCode | language code |
The documentation for this protocol was generated from the following file: