Get outgoing friend requests
Use the OutgoingFriendRequests
property to retrieve the current user’s outgoing friend requests list. The following code snippet shows the usage of the OutgoingFriendRequests
property.
/// <summary>
/// The list of the user's outgoing friend requests.
/// </summary>
IList<Relationship> OutgoingFriendRequests { get; }
The following code snippet shows how to get the outgoing friend requests for the current user.
// Initialize the Friends service
await FriendsService.Instance.InitializeAsync();
IReadOnlyList<Relationship> outgoingFriendRequests = FriendsService.Instance.OutgoingFriendRequests;
Debug.Log("Outgoing Friend Requests: " + outgoingFriendRequests.Count);
foreach (var request in outgoingFriendRequests)
{
Debug.Log("User ID: " + request.Member.Id);
}