Package com.bitheads.braincloud.services
Class FriendService
java.lang.Object
com.bitheads.braincloud.services.FriendService
public class FriendService extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFriendService.FriendPlatform -
Constructor Summary
Constructors Constructor Description FriendService(BrainCloudClient client) -
Method Summary
Modifier and Type Method Description voidaddFriends(String[] profileIds, IServerCallback callback)Links the current user and the specified users as brainCloud friends.voidaddFriendsFromPlatform(FriendService.FriendPlatform friendPlatform, String mode, String[] externalIds, IServerCallback callback)Links the profiles for the specified externalIds for the given friend platform as internal friends.voidfindUserByExactUniversalId(String searchText, IServerCallback callback)Retrieves profile information for the partial matches of the specified text.voidfindUsersByExactName(String searchText, int maxResults, IServerCallback callback)Finds a list of users matching the search text by performing an exact match search Service Name - friend Service Operation - FIND_USERS_BY_EXACT_NAMEvoidfindUsersByNameStartingWith(String searchText, int maxResults, IServerCallback callback)Retrieves profile information for users whose names starts with search text.voidfindUsersBySubstrName(String searchText, int maxResults, IServerCallback callback)Finds a list of users matching the search text by performing a substring search of all user names.voidfindUsersByUniversalIdStartingWith(String searchText, int maxResults, IServerCallback callback)Retrieves profile information for users whose universal Id starts with search text.voidgetExternalIdForProfileId(String profileId, String authenticationType, IServerCallback callback)Retrieves the external ID for the specified user profile ID on the specified social platform.voidgetMySocialInfo(FriendService.FriendPlatform friendPlatform, Boolean includeSummaryData, IServerCallback callback)Retrieves the social information associated with the logged in user.voidgetProfileInfoForCredential(String externalId, AuthenticationType authenticationType, IServerCallback callback)Retrieves profile information for the specified user.voidgetProfileInfoForExternalAuthId(String externalId, String externalAuthType, IServerCallback callback)Retrieves profile information for the specified external auth user.voidgetSummaryDataForProfileId(String profileId, IServerCallback callback)Returns state of a particular user.voidgetUsersOnlineStatus(String[] profileIds, IServerCallback callback)Get users online status Service Name - Friend Service Operation - GET_USERS_ONLINE_STATUSvoidlistFriends(FriendService.FriendPlatform friendPlatform, Boolean includeSummaryData, IServerCallback callback)Retrieves a list of player and friend platform information for all friends of the current player.voidreadFriendEntity(String friendId, String entityId, IServerCallback callback)Returns a particular entity of a particular friend.voidreadFriendsEntities(String entityType, IServerCallback callback)Returns entities of all friends based on type Service Name - Friend Service Operation - ReadFriendsEntitiesvoidreadFriendUserState(String friendId, IServerCallback callback)Read a friend's user state.voidremoveFriends(String[] profileIds, IServerCallback callback)Unlinks the current user and the specified users as brainCloud friends.
-
Constructor Details
-
FriendService
-
-
Method Details
-
getProfileInfoForCredential
public void getProfileInfoForCredential(String externalId, AuthenticationType authenticationType, IServerCallback callback)Retrieves profile information for the specified user. Service Name - friend Service Operation - GET_PROFILE_INFO_FOR_CREDENTIAL- Parameters:
externalId- The users's external IDauthenticationType- The authentication type of the user IDcallback- The callback handler
-
getProfileInfoForExternalAuthId
public void getProfileInfoForExternalAuthId(String externalId, String externalAuthType, IServerCallback callback)Retrieves profile information for the specified external auth user. Service Name - friend Service Operation - GET_PROFILE_INFO_FOR_EXTERNAL_AUTH_ID- Parameters:
externalId- External ID of the user to findexternalAuthType- The external authentication type used for this users's external IDcallback- The callback handler
-
getExternalIdForProfileId
public void getExternalIdForProfileId(String profileId, String authenticationType, IServerCallback callback)Retrieves the external ID for the specified user profile ID on the specified social platform. Service Name - Friend Service Operation - GET_EXTERNAL_ID_FOR_PROFILE_ID- Parameters:
profileId- Profile ID.authenticationType- The authentication type e.g. Facebookcallback- The callback handler
-
findUsersByExactName
Finds a list of users matching the search text by performing an exact match search Service Name - friend Service Operation - FIND_USERS_BY_EXACT_NAME- Parameters:
searchText- The string to search for.maxResults- Maximum number of results to return.callback- Method to be invoked when the server response is received.
-
findUsersBySubstrName
Finds a list of users matching the search text by performing a substring search of all user names. Service Name - friend Service Operation - FIND_USERS_BY_SUBSTR_NAME- Parameters:
searchText- The substring to search for. Minimum length of 3 characters.maxResults- Maximum number of results to return. If there are more the messagecallback- Method to be invoked when the server response is received.
-
findUserByExactUniversalId
Retrieves profile information for the partial matches of the specified text.- Parameters:
searchText- Universal Id text on which to searchcallback- The callback handler
-
readFriendEntity
Returns a particular entity of a particular friend. Service Name - Friend Service Operation - ReadFriendEntity- Parameters:
friendId- Profile Id of friend who owns entity.entityId- Id of entity to retrieve.callback- The callback handler
-
readFriendsEntities
Returns entities of all friends based on type Service Name - Friend Service Operation - ReadFriendsEntities- Parameters:
entityType- Types of entities to retrieve.callback- The callback handler
-
readFriendUserState
Read a friend's user state. If you are not friend with this user, you will get an error with NOT_FRIENDS reason code. Service Name - PlayerState Service Operation - ReadFriendsPlayerState- Parameters:
friendId- Target friendcallback- The callback handler
-
listFriends
public void listFriends(FriendService.FriendPlatform friendPlatform, Boolean includeSummaryData, IServerCallback callback)Retrieves a list of player and friend platform information for all friends of the current player. Service Name - Friend Service Operation - LIST_FRIENDS- Parameters:
friendPlatform- Friend platform to query.includeSummaryData- True if including summary data; false otherwise.callback- Method to be invoked when the server response is received.
-
getMySocialInfo
public void getMySocialInfo(FriendService.FriendPlatform friendPlatform, Boolean includeSummaryData, IServerCallback callback)Retrieves the social information associated with the logged in user. Includes summary data if includeSummaryData is true. Service Name - Friend Service Operation - GET_MY_SOCIAL_INFO- Parameters:
friendPlatform- Friend platform to query.includeSummaryData- True if including summary data; false otherwise.callback- Method to be invoked when the server response is received.
-
addFriends
Links the current user and the specified users as brainCloud friends. Service Name - Friend Service Operation - ADD_FRIENDS- Parameters:
profileIds- Collection of profile IDs.callback- Method to be invoked when the server response is received.
-
addFriendsFromPlatform
public void addFriendsFromPlatform(FriendService.FriendPlatform friendPlatform, String mode, String[] externalIds, IServerCallback callback)Links the profiles for the specified externalIds for the given friend platform as internal friends. Service Name - Friend Service Operation - ADD_FRIENDS_FROM_PLATFORM- Parameters:
friendPlatform- Platform to add from (i.e: "Facebook").mode- ADD or SYNC.externalIds- Collection of external IDs from the friend platform.callback- Method to be invoked when the server response is received.
-
removeFriends
Unlinks the current user and the specified users as brainCloud friends. Service Name - Friend Service Operation - REMOVE_FRIENDS- Parameters:
profileIds- Collection of profile IDs.callback- Method to be invoked when the server response is received.
-
getSummaryDataForProfileId
Returns state of a particular user.- Parameters:
profileId- Profile Id of user to retrieve user state for.callback- Method to be invoked when the server response is received.
-
getUsersOnlineStatus
Get users online status Service Name - Friend Service Operation - GET_USERS_ONLINE_STATUS- Parameters:
profileIds- Collection of profile IDs.callback- Method to be invoked when the server response is received.
-
findUsersByNameStartingWith
public void findUsersByNameStartingWith(String searchText, int maxResults, IServerCallback callback)Retrieves profile information for users whose names starts with search text. Optional parameter maxResults allows you to search an amount of names. Service Name - Friend Service Operation - FIND_USERS_BY_NAME_STARTING_WITH- Parameters:
searchText- Collection of profile IDs.maxResults- how many names you want to returncallback- Method to be invoked when the server response is received.
-
findUsersByUniversalIdStartingWith
public void findUsersByUniversalIdStartingWith(String searchText, int maxResults, IServerCallback callback)Retrieves profile information for users whose universal Id starts with search text. Optional parameter maxResults allows you to search an amount of names. Service Name - Friend Service Operation - FIND_USERS_BY_UNIVERSAL_ID_STARTING_WITH- Parameters:
searchText- Collection of profile IDs.maxResults- how many names you want to returncallback- Method to be invoked when the server response is received.
-