question

hasan avatar image
hasan asked

How Can I Set a Big Picture In The Push Notification

I have this cloud script that sends a notification to the users, but how can I set a banner (big picture) in the push notification with a given URL?

 handlers.sendPushNotification = (args, context) => {
   try {
     const bigPictureUrl =
       "https://firebasestorage.googleapis.com/v0/b/project-id.appspot.com/o/FCMImages%2Fnotification-banner-7.png";
     server.SendPushNotification({
       Recipient: currentPlayerId,
       Package: {
         Title: "Test",
         Message: `This is a test`,
       },
     });
     return {};
   } catch (err) {}
 };

Here is what I did in Firebase Console and worked with me:

6946-image-1.png

CloudScriptPush Notifications
image-1.png (65.7 KiB)
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

·
Neils Shi avatar image
Neils Shi answered

If you mean you want to push notification with the picture, then please note that https://learn.microsoft.com/en-us/rest/api/playfab/server/account-management/send-push-notification?view=playfab-rest doesn’t have the parameter to set picture. So, you may consider including the URL link of the image in the notification message or using an external push service to achieve this functionality. If you mean you just want to display your game icon next to the message in notifications, then you may set the "Icon" in " Package" parameter to implement it. For more info, please refer to https://learn.microsoft.com/en-us/rest/api/playfab/server/account-management/send-push-notification?view=playfab-rest#pushnotificationpackage:~:text=Push%20Notification%20plugins-,Icon,Icon%20file%20to%20display%20with%20the%20message%20(Not%20supported%20for%20iOS),-Message .

10 |1200

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

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.