Hello, I went through a lot of questions on the forum, but I still could not find an unambiguous solution to the problem.
What's the best way to send game events to the user?
Examples:
1. The player was taken to the clan and the event must be sent to him, so the user interface on his client is updated.
2. A friend of the player sent him help, and the list of currencies on the client has to update.
3. A friend request has been sent and a popup with the request must be shown.
Also, there are more similar events as well.
I have seen solutions using push notifications, but everywhere is written that you should not use this solution for the main logic of the game.
Answer by SethDu · Jun 02, 2021 at 09:49 AM
It is not supported by default due to the RESTful nature of PlayFab, and you have to send a request to get a response. However, it is possible to send messages to the client via Push Notification, and with the help of Rules feature, certain event will trigger the actions like sending push notification to the target players. Please refer to Push Notifications - PlayFab | Microsoft Docs.
Meanwhile, if you mean the real-time messaging, you may consider implementing SignalR to realize this feature. Good news is that we provide an official sample on GitHub -- MessagingClient. It is the fundamental implementation of preview feature PubSub (Please note that this feature has been delayed as you can see it is not included in the roadmap).
Player Name in Push notification template/ Localization of Push notification messsages 1 Answer
Avoid push notfication errors when sending notification to friends 1 Answer
ailed to import package with error: Couldn't decompress package 1 Answer
Friend request timeout? 1 Answer
Get player ID by name 1 Answer