question

Brian Matt avatar image
Brian Matt asked

Is it possible to send "messages" to clients using Cloud Script?

The use case here is something like this... we have a custom social structure that involves invites. Player 1 wants to invite player 2 to join so player 1 calls a cloudscript function to initiate the invite. The cloudscript does some work and then sends a "message" or "notification" to player 2 that they are invited. If player 2 accepts, they call another cloudscript function which in turn notifies the entire social group that a new player has joined.

Is something like this possible with CloudScript?

Thanks!

CloudScript
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

·
Seth Du avatar image
Seth Du answered

To be clear, cloud script cannot actively send messages to clients. I am not sure if the requirement is real-time messaging, I suggest implementing Party for real-time messaging and chatting -- Azure PlayFab Party overview - PlayFab | Microsoft Docs.

However, if near-time is permitted. You may store invitation messages via SharedGroupData. You are able to assign Shared Group Name into Player Data via Cloud Script for each player but the client will need to refresh data from time to time. Notifications for entire group is not possible by this method. It is not recommended to use Push Notification, because in the common scenario it is a server-side channel to get players notified. While when this feature is available to players, there can be abusive use, which may cost a lot.

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.