Closed FI407 closed 8 months ago
I have no idea, please consult the Google Cloud Messaging documentation.
Messages::Message msg; msg has a member : fcm_options has priority property how can use it?
Please try.
Messages::AndroidConfig androidConfig;
// Priority of a message to send to Android devices.
// https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidmessagepriority
androidConfig.priority(Messages::AndroidMessagePriority::_HIGH);
Messages::AndroidNotification androidNotification;
// 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.
// https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#NotificationPriority
androidNotification.notification_priority(Messages::NotificationPriority::PRIORITY_HIGH);
androidConfig.notification(androidNotification);
msg.android(androidConfig);
You can look at this file for the complete classes and enums that created and based on the JSON data representations and enumerations from Google Cloud Messaging REST API doc.
https://github.com/mobizt/FirebaseClient/blob/main/src/messaging/DataOptions.h
Thank you @mobizt completely resolved.
How to send high priority notification?