Priority in a notification using firebase

Asked

Viewed 60 times

0

I am using Ionic and everything is configured to send the notification...

I wanted to increase the importance of it because it does not make noise and does not appear in the upper corner as a standard notification (like Whatsapp)

How can I increase notification importance using the Firebase Cloud Messaging API

1 answer

0

I imagine you’re wearing the FCM Ionic plugin.

On the documentation page, there is an example using the field "Priority":"high":

{
  "notification":{
    "title":"Notification title",
    "body":"Notification body",
    "sound":"default",
    "click_action":"FCM_PLUGIN_ACTIVITY",
    "icon":"fcm_push_icon"
  },
  "data":{
    "param1":"value1",
    "param2":"value2"
  },
    "to":"/topics/topicExample",
    "priority":"high",
    "restricted_package_name":""
}

To use, just use some tool you post, as the Postman.

  • Actually no, I’m using the phone-gap push Notifications

  • in this case the property is called "importance". https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/API.md#Channel-properties

Browser other questions tagged

You are not signed in. Login or sign up in order to post.