Skip to main content
PlaytoliaSocial manages the friends list, player search, and friend request workflows. Data loads automatically after login.

Friends list

var friends = PlaytoliaSocial.GetFriends();
foreach (var friend in friends)
    Debug.Log($"{friend.User.DisplayName}{friend.User.Status}");

Searching for players

var results = PlaytoliaSocial.SearchPlayers("username");
// returns List<Player>
This is a blocking network call — call it off the main thread or in response to user input, not in Update().

Friend requests

// Send
PlaytoliaSocial.SendFriendRequest(player.PlayerId);   // use PlayerId, not Id or Uid

// View pending
var incoming = PlaytoliaSocial.GetIncomingFriendRequests();
var outgoing = PlaytoliaSocial.GetOutgoingFriendRequests();

// Respond
PlaytoliaSocial.AcceptFriendRequest(request.RequestId);
PlaytoliaSocial.RejectFriendRequest(request.RequestId);
PlaytoliaSocial.CancelFriendRequest(request.RequestId);  // cancel outgoing

// Remove
PlaytoliaSocial.RemoveFriend(friend.FriendshipId);   // use FriendshipId, not PlayerId
SendFriendRequest takes a PlayerId. RemoveFriend takes a FriendshipId. Mixing these up is a common mistake.

Listening to changes

void Start()    => PlaytoliaSocial.AddListener(OnSocialChanged);
void OnDestroy() => PlaytoliaSocial.RemoveListener(OnSocialChanged);

void OnSocialChanged()
{
    var friends = PlaytoliaSocial.GetFriends();
    // update UI
}