question

Canberk Soner avatar image
Canberk Soner asked

Send notifications to players

I would like to send notifications to players when, for example, someone adds them to their friend list so they can see a message like "X has added you as a friend." Unlike standard push notifications, I'm talking about informing them of events that happen when they are online.

Does PlayFab support server-to-client messages, maybe through something like SignalR? If not, should I use push notifications for this purpose?

Otherwise, how viable is using PlayerData (or TitleData for non player specific messages) to save such events and have the clients poll them every X seconds, performance-wise?

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

·
JayZuo avatar image
JayZuo answered

If you are working with an Android/iOS game/application, then push notifications would be a good choice. Push notification can be used in the scenario where notifications only be displayed when the client is in foreground (uses are online). For example, in FCM, you can send Data messages, which are handled by your client app. You can decide whether to show the notification or not. Polling is always not recommended. If the client make a lot of duplicate calls in a short period, it might be thought as malicious client and got throttled.

PlayFab will also provide a Two-way Connectivity (aka PubSub) to send a custom event to individual players via a server API later in Q4. For more info, please see PlayFab Roadmap: 2018 Q3 and Upcoming Roadmap: 2018 Q4.

2 comments
10 |1200

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

Canberk Soner avatar image Canberk Soner commented ·

Thanks for the help, we'll go with push notifications and data messages then.

However, is PlayStream still supported? I've seen this blogpost today:

https://blog.playfab.com/blog/new-playstream-feature-and-updates-to-the-playfab-game-server

"In one example, we friend a user that is “online” and then gift via CloudScript an item to that friend. The user that is the recipient of that item is then notified instantly that she received a new Item via a PlayStream Event Subscription and a Unity Networking message that is sent to that user’s game client."

I'm not sure I understand the situation here. How customizable is this? Is it dependant on unet? I've noticed that PlayFab Unity SDK also imports SignalR, so I assume this isn't related to Unity Networking?

0 Likes 0 ·
brendan avatar image brendan Canberk Soner commented ·

Ah, thanks - I hadn't realized that old blog post wasn't updated back then. The event subscription feature it mentioned was in preview at the time, but in testing what we found was that it was going to be costly to operate - so, we could have people use it, but we would have had to charge a consumption rate for it. That wasn't really viable for most folks, so we removed it at the time. I'll have them update that post to clarify for anyone else who runs into it.

But to be clear, PlayStream is the realtime event system in PlayFab. It makes sure that all events are delivered successfully, and that they are used for all the segmentation, rules, etc. that titles set up for their LiveOps. So PlayStream itself is absolutely supported - it's central to much of PlayFab.

1 Like 1 ·

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.