question

amrza-coc avatar image
amrza-coc asked

How to get notified when server change a data?

Hi, I was wondering if there is anyway to get notified when user data changes in server side?

I'm using cloud script for some of my game logic and my cloud script code may change some of user data fields, I wanted to know if there is anyway for client to get notified and sync it's data with new values?

dataCustom Game Servers
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

·
Hernando avatar image
Hernando answered

For now, I’d like to recommend you send data to the player by request.Package.CustomData in pushing notification. You can call the Server.SendPushNotification for the player when CloudScript changes any of the user data. And customize your client receiver to utilize that data to update the local data. But, be aware that Notification messages are delivered to the notification tray when the app is in the background. For apps in the foreground, messages are handled by a callback function. More information please see: https://firebase.google.com/docs/cloud-messaging/concept-options

Besides, you may also look forward to the PubSub feature which is in private preview now and it might be more suitable for your scenario.

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.