question

duartedd avatar image
duartedd asked

Send message to clients based on cloudscript call

Hello

I am trying to figure out a good way to send a message to the client from the server that basically says

'you received [this item]' with a picture and a close button

for example - if i call a cloudscript when i clear the leaderboards it grants all items users and if they are logged in it will popup.

Another thing was instead of using something like itemviewer in unicorn battle - using some sort of auto popup sender that has a rule everytime you receive an item or some currency ( grantitem - grant currency it sends a popup with the what and the how much or something

thanks!

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

I’d firstly recommend you our new feature PubSub, which is still in Private Preview. If you are Pro or Enterprise Tiers users, feel free to create a support ticket to access it. Otherwise, there can be complicated work around solutions.

For now, besides PubSub, there is no way to force Server to communicate with Clients. You still need to call some customized notification creation functions in the success callback of an API. For example, your client will refresh players’ inventory every x minutes, when the client notices the changes, call functions to pop up a notification.

Another work around solution is simply make server API calls like SendPushNotificationFromTemplate, SendPushNotification and craft your own content in the request after the granting related actions is done in the Cloud Script.

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.