public interface CaptainUpConnection
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).Modifier and Type | Method and Description |
---|---|
UserCaptainUpResponse |
addOrUpdateIntegrationUser(IntegrationUser user)
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.
|
void |
addOrUpdateIntegrationUserAsync(IntegrationUser user,
CaptainUpCallback<UserCaptainUpResponse> 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.
|
AuthenticatedCaptainUpConnection |
authenticate(User user)
Returns an
authenticated connection to captain up. |
GetActionCaptainUpResponse |
queryActions(java.lang.String playerId,
Query query)
Returns several actions and information about the users associated with them.
|
void |
queryActionsAsync(java.lang.String playerId,
Query query,
CaptainUpCallback<GetActionCaptainUpResponse> callback)
Returns several actions and information about the users associated with them.
|
LeaderboardCaptainUpResponse |
queryLeaderboard(LeaderboardTime time,
java.lang.String playerId,
Query query)
Returns several users from the requested leaderboard, including general information on
those users, and their position in the leaderboard.
|
void |
queryLeaderboardAsync(LeaderboardTime time,
java.lang.String playerId,
Query query,
CaptainUpCallback<LeaderboardCaptainUpResponse> callback)
Returns several users from the requested leaderboard, including general information on
those users, and their position in the leaderboard.
|
GetSocialFeedCaptainUpResponse |
querySocialFeed(Query query)
Returns the social feed, which is constructed by several actions from different users and information about the users associated with them.
|
void |
querySocialFeedAsync(Query query,
CaptainUpCallback<GetSocialFeedCaptainUpResponse> callback)
Returns several actions and information about the users associated with them.
|
ApplicationCaptainUpResponse |
retrieveApplication()
Returns all the current connected application's settings, including information on the action
settings, levels, badges and etc.
|
void |
retrieveApplicationAsync(CaptainUpCallback<ApplicationCaptainUpResponse> callback)
Returns all the current connected application's settings, including information on the action
settings, levels, badges and etc.
|
UserCaptainUpResponse |
retrieveUser(java.lang.String userId)
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).
|
void |
retrieveUserAsync(java.lang.String userId,
CaptainUpCallback<UserCaptainUpResponse> 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).
|
void |
setLanguageCode(java.lang.String 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.
|
ApplicationCaptainUpResponse retrieveApplication() throws CaptainUpException
CaptainUpException
retrieveApplicationAsync(CaptainUpCallback)
void retrieveApplicationAsync(CaptainUpCallback<ApplicationCaptainUpResponse> callback)
retrieveApplication()
since this will not block the
current thread until the request returns.callback
- a callback that will contain the response and any exception that might
have risen during the execution.retrieveApplication()
UserCaptainUpResponse addOrUpdateIntegrationUser(IntegrationUser user) throws CaptainUpException
user
- the user details to create or update. The user can be created using the
IntegrationUserBuilder
CaptainUpException
addOrUpdateIntegrationUserAsync(IntegrationUser, CaptainUpCallback)
void addOrUpdateIntegrationUserAsync(IntegrationUser user, CaptainUpCallback<UserCaptainUpResponse> callback) throws CaptainUpException
queryActions
since this will not block the current
thread until the request returns.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.CaptainUpException
addOrUpdateIntegrationUser(IntegrationUser)
GetActionCaptainUpResponse queryActions(java.lang.String playerId, Query query) throws CaptainUpException
playerId
- the ID of the player whose actions are requestedquery
- query parameters. To create a query object use QueryBuilder
CaptainUpException
queryActionsAsync(String, Query, CaptainUpCallback)
void queryActionsAsync(java.lang.String playerId, Query query, CaptainUpCallback<GetActionCaptainUpResponse> callback)
queryActions
since this will not block the current
thread until the request returns.playerId
- the ID of the player whose actions are requestedquery
- 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.queryActions(String, Query)
GetSocialFeedCaptainUpResponse querySocialFeed(Query query) throws CaptainUpException
query
- query parameters. To create a query object use QueryBuilder
CaptainUpException
#querySocialFeedAsync(String, Query, CaptainUpCallback)
void querySocialFeedAsync(Query query, CaptainUpCallback<GetSocialFeedCaptainUpResponse> callback)
queryActions
since this will not block the current
thread until the request returns.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.querySocialFeed(Query)
LeaderboardCaptainUpResponse queryLeaderboard(LeaderboardTime time, java.lang.String playerId, Query query) throws CaptainUpException
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
.
CaptainUpException
queryLeaderboardAsync(LeaderboardTime, String, Query, CaptainUpCallback)
void queryLeaderboardAsync(LeaderboardTime time, java.lang.String playerId, Query query, CaptainUpCallback<LeaderboardCaptainUpResponse> callback)
queryLeaderboard
since this will not block the current
thread until the request returns.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
.
callback
- a callback that will contain the response and any exception that might
have risen during the execution.queryLeaderboard(LeaderboardTime, String, Query)
UserCaptainUpResponse retrieveUser(java.lang.String userId) throws CaptainUpException
userId
- the user's captain-up IDCaptainUpException
retrieveUserAsync(String, CaptainUpCallback)
void retrieveUserAsync(java.lang.String userId, CaptainUpCallback<UserCaptainUpResponse> callback)
retrieveUser
since this will not block the current
thread until the request returns.userId
- the user's captain-up IDcallback
- callback that will contain the response and any exception that might
have risen during the execution.retrieveUser(String)
AuthenticatedCaptainUpConnection authenticate(User user)
authenticated connection
to captain up.
Some operations are only available after authentication.user
- the user to authenticate. This user can be acquired from the addOrUpdateIntegrationUser.authenticated connection
to captain up.addOrUpdateIntegrationUser(IntegrationUser)
,
addOrUpdateIntegrationUserAsync(IntegrationUser, CaptainUpCallback)
void setLanguageCode(java.lang.String languageCode)
languageCode
-