Skip to main content

Methods

MethodParametersReturnsNotes
GetFriends()List<Friend>In-memory
SearchPlayers(query)stringList<Player>Network call — blocking
GetIncomingFriendRequests()List<FriendRequest>
GetOutgoingFriendRequests()List<FriendRequest>
SendFriendRequest(playerId)stringvoidUses PlayerId, not Id
AcceptFriendRequest(requestId)stringvoid
RejectFriendRequest(requestId)stringvoid
CancelFriendRequest(requestId)stringvoidCancel outgoing request
RemoveFriend(friendshipId)stringvoidUses FriendshipId
GetState()SocialState
Refresh()voidManual sync
AddListener(listener)Actionvoid
RemoveListener(listener)Actionvoid

Friend

FieldTypeNotes
FriendshipIdstringUsed with RemoveFriend()
UserPlayerFriend’s profile
FriendsSincestringISO timestamp
UnreadCountintUnread messages (if messaging enabled)

FriendRequest

FieldTypeNotes
RequestIdstringUsed with Accept/Reject/Cancel
SenderIdstring
RecipientIdstring
SenderPlayer
RecipientPlayer
CreatedAtstring

Player

FieldTypeNotes
IdstringInternal ID
PlayerIdstringUsed with SendFriendRequest()
DisplayNamestring
Usernamestring
AvatarstringURL
Statusstring"online" or "offline"
CreatedAtstring