question

kendrickvillaruel avatar image
kendrickvillaruel asked

Push Notification Package icon parameter

I don't see any documentation on how to use the "Icon" parameter. can you guide please?

Push Notifications
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

·
Seth Du avatar image
Seth Du answered

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.

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kendrickvillaruel avatar image kendrickvillaruel commented ·

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

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan kendrickvillaruel commented ·

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.

2 Likes 2 ·
kendrickvillaruel avatar image kendrickvillaruel Citrus Yan commented ·

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

0 Likes 0 ·
Show more comments
Seth Du avatar image Seth Du ♦ kendrickvillaruel commented ·

You may also see some useful information by clicking "What's this?" button(with a book icon) on the right top of Push Notification Templates page.

1 Like 1 ·

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.