question

jojorritbro avatar image
jojorritbro asked

How do i make a friend request system for unreal engine

I tried something with a add friend system but it didnt seem to work as i expected, it added the friend auto without the other player accepting a request, so i want someone to be able to accept a request and someone be able to send one.

Friends
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

Currenctly, PlayFab add friend system is more like a following system and cannot send or accept friend request. You may need to implement the friend request system by yourself. And here is a workaround you can refer to:

  • Player 1 calls the friend request function to send a friend request to Player 2. In the friend request function, use AddFriend on both players, setting each in the other player's friend list. Use SetFriendTags on both players, to tag the players uniquely ("requester"/"requestee", or similar).Then Title uses Push Notification (via Azure Function) to send notification to the other player.

  • Player 2 sees the Push or finds the friend request upon login (using GetFriendsList, checking for the "requester" tag)

  • Player 2 calls accept friend request function or decline friend request function to accept or decline the friend request. In the accept friend function, either remove the tags from both players or set them to something like "confirmed". In the decline friend function, remove each player from the other player's friend list.

You may implement the friend request function, accept friend function and decline friend function with Azurefunction. You can refer to PlayFab CloudScript using Azure Functions Quickstart Guide - PlayFab | Microsoft Learn to have more information about AzureFunction.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.