Send "notification_priority" enum value in FCM notification message

Viewed 235

For setting the notification priority, the FCM docs just state the following without an example.

"notification_priority": enum (NotificationPriority),

Set the relative priority for this notification. Priority is an indication of how much of the user's attention should be consumed by this notification. Low-priority notifications may be hidden from the user in certain situations, while the user might be interrupted for a higher-priority notification. The effect of setting the same priorities may differ slightly on different platforms. Note this priority differs from AndroidMessagePriority. This priority is processed by the client after the message has been delivered, whereas AndroidMessagePriority is an FCM concept that controls when the message is delivered.

https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notificationpriority

I'm trying to set the JSON based on this as follows, but it is clearly not sending a low priority notification.

{
    "to": "topic",
    "notification": {
        ...
        "notification_priority": {
            "NotificationPriority": "PRIORITY_MIN"
        }
    }
}

What would be the correct JSON format?

0 Answers
Related