I am wondering if there is any possibility to add information to the push notifications that gets sent, without showing them to the end user? I would like to know what the push notification is about, and if its a move within a game, the ID of the game that sent it. I see there is a table called “custom” in the event of a notification. Is that something we can use? and if so, how do we use it? Because all I can see now is the “user Alert”.
That is the purpose of the custom table. When you do a submitMove() it should send out the push notification with the custom table already populated that contains the value of what you sent with submitMove. Likewise, if you are sending from the dashboard, the “Payload” field is expected to be a valid JSON string that will be the custom table.
As for the other cloud multiplayer API calls, unless there is a parameter for custom data, then I doubt you will have any control over those. They may or may not use it. The fields that take a userAlert parameter is the visible part of the message.
Thanks for the answere Rob! Could you also give me an example of how to do this with a submitMove? all I see from the guide is the alert message so not sure how to populate this custom table?
from the multiplayer guide:
[lua]
local params = {
moveContent = “the move data”,
userAlert = “alert message”
}
I have tried looking through the other push notification examples and tutorials, but they dont really show me anything that can point me to what could be wrong here. So can I please get some confirmation that the event.custom is supposed to work? And how is the code supposed to look? because no matter what I try the custom part still comes back empty.
That is the purpose of the custom table. When you do a submitMove() it should send out the push notification with the custom table already populated that contains the value of what you sent with submitMove. Likewise, if you are sending from the dashboard, the “Payload” field is expected to be a valid JSON string that will be the custom table.
As for the other cloud multiplayer API calls, unless there is a parameter for custom data, then I doubt you will have any control over those. They may or may not use it. The fields that take a userAlert parameter is the visible part of the message.
Thanks for the answere Rob! Could you also give me an example of how to do this with a submitMove? all I see from the guide is the alert message so not sure how to populate this custom table?
from the multiplayer guide:
[lua]
local params = {
moveContent = “the move data”,
userAlert = “alert message”
}
I have tried looking through the other push notification examples and tutorials, but they dont really show me anything that can point me to what could be wrong here. So can I please get some confirmation that the event.custom is supposed to work? And how is the code supposed to look? because no matter what I try the custom part still comes back empty.