Friend
Friends in brainCloud are other users (i.e. players) that you want to share your user experience with. Friends may be existing connections from a social network (i.e. Facebook), or social connections that you make that are specific to the app and managed by brainCloud.
brainCloud can help to manage these friends - and use them for the basis of higher-level features such as social leaderboards.
The methods of this service fall into the following categories:
- Friend management - for directly managing the list of brainCloud friends
- Friend lookup - for looking up new friend candidates
- Friend data access - for accessing data associated with a friend
API Summary
Friend Management
- AddFriends - Adds brainCloud profile IDs to local friends.
- ListFriends - Retrieves the friend summary data associated with the logged in user. Optional parameters: includeNetworkFriends and includeSummaryData
- RemoveFriends - Removes brainCloud profile IDs from local friends.
User Lookup
By Universal ID:
- FindUserByExactUniversalId - Retrieves profile information for the partial Universal ID matches of the specified text.
- FindUsersByUniversalIdStartingWith - Retrieves profile information for users whose universal ID starts with search text. Optional parameter: maxResults
By Name (not recommended - slow!):
- FindUsersByExactName - Retrieves profile information for exactly matched user names. Optional parameter: maxResults
- FindUsersBySubstrName - Retrieves profile information for partially matched user names. Optional parameter: maxResults
- FindUsersByNameStartingWith - Retrieves profile information for users whose name starts with search text. Optional parameter: maxResults
By Other Identity:
- GetProfileInfoForCredential - Retrieves profile information for the specified user.
- GetProfileInfoForCredentialIfExists - Retrieves profile information for the specified user. Silently fails
- GetProfileInfoForExternalAuthId - Retrieves profile information for the specified user.
- GetProfileInfoForExternalAuthIdIfExists - Retrieves profile information for the specified user. Silently fails
Misc:
- FindUsersByUserSummary - Retrieves profile information based on the search criteria of the user summary data.
- GetUsersOnlineStatus - Get users online status.
- GetExternalIdForProfileId - Retrieves the external ID for the specified user profile ID on the specified social platform.
- GetSummaryDataForProfileId - Retrieves summary information for the specified user profile ID.
Friend Data Access
- ReadFriendEntity - Reads entity data of friend.
- ReadFriendsEntities - Reads entities data of friends.
- ReadFriendUserState - Updates the friend summary data associated with the logged in user.
Summary Friend Data (also referred to as simply Friend Data) is special game summary data that is made available to a user's friends.
This is normally used to provide additional information for use in social leaderboards and/or neighbor displays.
Common examples of friend data include experience level, player level title, etc. Summary Friend data is updated via the
UpdateSummaryFriendData
method.
Any app that relies on access to the user's Facebook friends will require the "user_friends" permission when authenticating with Facebook. See the Facebook API documentation for how to request the "user_friends" permission.
📄️ AddFriends
Links the current user and the specified users as friends.
📄️ AddFriendsFromPlatform
Links the profiles for the specified externalIds for the given friend platform as internal friends.
📄️ FindUserByExactUniversalId
Retrieves profile information for the partial Universal ID matches of the specified text.
📄️ FindUserByUniversalId
Retrieves user information for partially matched universal IDs. Optional parameter: maxResults.
📄️ FindUsersByExactName
Retrieves profile information for the exact matches of the specified text.
📄️ FindUsersByNameStartingWith
Retrieves profile information for users whose name starts with search text. Optional parameter: maxResults
📄️ FindUsersBySubstrName
Retrieves profile information for an exact text match, then it retrieves partial matches of the specified text.
📄️ FindUsersByUniversalIdStartingWith
Retrieves profile information for users whose universal ID starts with search text. Optional parameter: maxResults
📄️ FindUsersByUserSummary
Retrieves profile information based on the search criteria of the user summary data.
📄️ GetExternalIdForProfileId
Retrieves the external ID for the specified user profile ID on the specified social platform.
📄️ GetMySocialInfo
Retrieves the social information associated with the logged in user. Includes summary data if includeSummaryData is true.
📄️ GetProfileInfoForCredential
Retrieves profile information for the specified user.
📄️ GetProfileInfoForCredentialIfExists
Retrieves profile information for the specified user. Silently fails, if profile does not exist, just returns null and success, instead of an error.
📄️ GetProfileInfoForExternalAuthId
Retrieves profile information for the specified external auth user.
📄️ GetProfileInfoForExternalAuthIdIfExists
Retrieves profile information for the specified user. Silently fails, if profile does not exist, just returns null and success, instead of an error.
📄️ GetSummaryDataForProfileId
Retrieves the summary information for the specified user profile ID.
📄️ GetUsersOnlineStatus
Get the online status for a list of users based on profile ID.
📄️ ListFriends
Retrieves a list of user and friend platform information for all friends of the current user.
📄️ ReadFriendEntity
Returns a particular entity of a particular friend.
📄️ ReadFriendsEntities
Returns entities of all friends based on type and/or subtype.
📄️ ReadFriendUserState
Read a friend's user state. If the specified Id is not a friend of the current user, will get "Not friends" message (40310) back.
📄️ RemoveFriends
Unlinks the current user and the specified users as friends.