I don't see any documentation on how to use the "Icon" parameter. can you guide please?
I don't see any documentation on how to use the "Icon" parameter. can you guide please?
As far as I know, it is the relative path of icon resource in your client. When then client receives the data in the Package properties, you may make use of the path to read the icon resources to craft a notification.
Though I'd recommend you to make use the new feature Push Notification Template, where you are able to config different contents for different target platforms. Multiple languages are supported as well.
Thanks for the reply. I have tried push notifications template but i'm having "Android custom payload is invalid" error.
can you please advice what's wrong? thanks
Hi Kendrick, The Android payload consists of two key-value pairs, "notification" and "data". The "notification" key-value should contain the predefined key-value pairs of the android notification payload and "data" is an object that you can put your custom data into. Hence the key “notification” is required for the android payload. For instance, the following payload for Android should work fine:
{
"notification": {
"Title" : "title",
"Message" : "message",
"Badge" : "1",
"icon" : "default_icon"
}
}
Now, since you must define both Android payload and IOS payload. I don’t know how did you define the IOS payload, in case you were to encounter the same issue with IOS payload, here is the sample format(the key “aps” is needed):
{
"aps": {
"Title" : "title",
"Message" : "message",
"Badge" : "1",
"icon" : "default_icon"
}
}
Here is the doc for more info about Android payload and IOS payload you may find helpful.
Thanks for this, i was able to get passed the "invalid" error.
However, it is not displaying the icon in my notifications unlike when i used the SendPushNotification API i posted above.
Not sure if it's playfab now or the plugin I am using
3 People are following this question.