Class FriendService

java.lang.Object
com.bitheads.braincloud.services.FriendService

public class FriendService
extends Object
  • Constructor Details

  • 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 ID
      authenticationType - The authentication type of the user ID
      callback - 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 find
      externalAuthType - The external authentication type used for this users's external ID
      callback - 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. Facebook
      callback - The callback handler
    • findUsersByExactName

      public void findUsersByExactName​(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_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

      public void findUsersBySubstrName​(String searchText, int maxResults, IServerCallback callback)
      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 message
      callback - Method to be invoked when the server response is received.
    • findUserByExactUniversalId

      public void findUserByExactUniversalId​(String searchText, IServerCallback callback)
      Retrieves profile information for the partial matches of the specified text.
      Parameters:
      searchText - Universal Id text on which to search
      callback - The callback handler
    • readFriendEntity

      public void readFriendEntity​(String friendId, String entityId, IServerCallback callback)
      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

      public void readFriendsEntities​(String entityType, IServerCallback callback)
      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

      public void readFriendUserState​(String friendId, IServerCallback callback)
      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 friend
      callback - 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

      public void addFriends​(String[] profileIds, IServerCallback callback)
      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

      public void removeFriends​(String[] profileIds, IServerCallback callback)
      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

      public void getSummaryDataForProfileId​(String profileId, IServerCallback callback)
      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

      public void getUsersOnlineStatus​(String[] profileIds, IServerCallback callback)
      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 return
      callback - 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 return
      callback - Method to be invoked when the server response is received.