I want to use SendPushNotification server API in Cloud Script to notify the player, for example when the player won an item or virtual currency. Is it possible to store the subject and the message of this push notification somewhere in title player account?
I need to store the subject and the message somewhere so that the player can read it when he wants.
Is there something similar like PlayFabClientAPI.GetTitleNews for push notifications so that the player can read his notifications when he wants?
Answer by SethDu · Feb 20, 2020 at 06:47 AM
You may use Player Data to store it or directly store locally in the client. I don’t think it necessary to be stored somewhere safe like Player Read-only data because it only for reading.
If you want to store on the server side so that player can review it at any time or after switching to a new device, I think you can add a client API call UpdateUserData to upload the notification contents (in OnMessageReceived Functions if it is in Android). Meanwhile, as I have noticed in many mobile games on the market, they may directly cache the data locally to reduce the server loads.
I found out that the free limit for player data value size is 10,000 bytes. But how many free player data key/value pairs can I create?
I'm not sure if I should create one key/value pair for each push notification that I send to the player.
There is no specified limit to the amount number of data entries, the player data value size 10,000 bytes should be calculated via total key size plus total value size.
Is it possible to display the current used total size(key size + value size) in Game Manager?
What happens if a player already uses 10,000 bytes and if my cloud script tries to create a new key/value pair for this player? Does cloud script create the key/value pair in this case or not?