Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add mutable_content in APNS payload using Firebase Notifications console?

Not able to figure out how to send mutable_content=true in aps dictionary. This is the json payload which i recieve when i send notification from firebase messaging console

{
    aps =     {
        alert =         {
            body = "50% off on booking ";
            title = "CompanyName 50% coupon ABC50OFF";
        };
        sound = default;
    };
    "attachment-url" = "https://www.xxxxxxxxx.com/campaign/images_thumb/Toyota-Fortuner-AT.jpg";
    "click_action" = reminder;
    "content_available" = 1;
    "gcm.message_id" = "0:1491225835295720%a84b45aaa84b45aa";
    "gcm.n.e" = 1;
    "gcm.notification.sound2" = default;
    "google.c.a.c_id" = 3829383583613273032;
    "google.c.a.e" = 1;
    "google.c.a.ts" = 1491225835;
    "google.c.a.udt" = 0;
    "mutable_content" = 1;
}
like image 734
Sourabh Shekhar Avatar asked Jan 05 '23 05:01

Sourabh Shekhar


1 Answers

It it is currently not possible to set the value of mutable_content when using the Firebase Notifications Console. You'll have to build the payload yourself, something like this:

{
    "to": "<REGISTRATION_TOKEN_HERE>",
    "mutable-content" : true,
    "notification": {
        "body" : "Eureka!",
        "title": "Patient is not doing well",
        "click_action" : "provider-body-panel"
    }
}

Then send it from your own App Server. You could also do this by using Postman or cURL

Modified portion from my answer here.

like image 115
AL. Avatar answered Jan 30 '23 19:01

AL.