Use the SDK to query friend list - Display friend list - (Unity module)
Last updated on October 24, 2024
Implement getting friend list
Open FriendsEssentialsWrapper_Starter.cs
and create a function called GetFriendList
. This function will retrieve the friend list.
public void GetFriendList(ResultCallback<Friends> resultCallback = null)
{
_lobby.LoadFriendsList(result =>
{
if (!result.IsError)
{
Debug.Log($"Success to get friend list");
}
else
{
Debug.LogWarning(
$"Error LoadFriendsList, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
resultCallback?.Invoke(result);
});
}
Resources
- The file used in this tutorial is available in the Unity Byte Wars GitHub repository.