Hello, we are working on a mobile multiplayer game. We use PlayFab for accounts and save data, Photon for rooms and general networking gameplay, and Unity as our game engine. In our game it is very important to have friends. I have worked tirelessly on this issue... First we needed friend request so I figured out this (very difficult) system for request confirmation. At the end this was no help what so ever because we need more... We want to be able to send friend request and the requested player instantly (obvious delay) receives the request and can accept it. Then once friends, they should be able to chat, invite to a team party, etc... This all is surrounded by a specific problem. PlayFab allows no way (that I or any help I've been given know of) to send data to a player that receives a callback when they receive it. I have tried using cloud script and have found no way. Please help or give any useful information you have. Thanks!
Answer by SethDu · May 24, 2021 at 06:11 AM
For a private chat, we usually suggest using Shared Group Data to store logs and it can be handled by Cloud Script/Azure Function, while SendPushNotification API can be called there to inform the another player. This solution can be applied to a small group, but is not recommended when there is a large group because concurrent data writing error can occur.
A better solution is to use the new feature PlayFab Party, please refer to: Azure PlayFab Party overview - PlayFab | Microsoft Docs. In addition, since you are using Photon, using Photon chat is also feasible.
In terms of friend request, it can be done via Cloud Script/Azure function. Here is some tips:
@SethDuThanks for your response! First of all I need to clarify that we are using the free version of PlayFab (which to my knowledge does not support PlayFab multiplayer). And about the friend requests this is exactly what I did... The problem is that it is not realtime. So when a friend request is sent there is no way to have something happen realtime on the requested players screen because there is no realtime callback feature. Am I missing something?
It is not supported due to the Restful API nature of PlayFab. As a workaround, you may send push notification when player approves or declines the request, while the client can force a refresh when the player clicks the notification. Otherwise, the client should refresh the data in a specific interval and updates the latest request list every time they open that panel.
How to handle winning and rewarding in a game? 1 Answer
Saving Player Data 2 Answers
Friends List Display Name 2 Answers
Is it possible to get all player data for specific title? 1 Answer