Hello! Here are a few questions regarding the use of pushClient.SendPlayerMessageAsync (I couldn’t find answers in the documentation).
- If a player was offline at the time the message was sent, will they receive it when they come online? If so, how long do they have a chance to receive this message?
- If some data is transmitted along with the message, are there any restrictions on it?
Thank you.
Hi @Kurutah
If a player was offline at the time the message was sent, will they receive it when they come online?
The player would have to be connected at the time to receive the message. As we do not currently provide message history as part of the push messaging feature they would not receive the message if they were offline.
You could look at storing the messages in Cloud Save, then the push message could be used to simply trigger a fetch of the messages from Cloud Save. If the user was offline then when they next log in they can send a Cloud Save request for any missed messages as part of the logging in process.
If some data is transmitted along with the message, are there any restrictions on it?
The push messages currently have a 10kb limit (via Limits)
1 Like
Hello @samg-unity,
Is there a way for the server to know if the player is online and/or the player has received the message without the player client "ack"ing it?
Im currenly using this for message, but the problem I’m having is I don’t know if the player received the message or not from the basic call/reply, only if there is an error.
On the cloud code side I use this call:
SendMessageReply reply = await _pushClient.SendPlayerMessageAsync()
I have it setup so if there is an error, the message is stored and the player retrieves it on logon and I want this same functionality if the user did not receive the message or is offline.