FCM Push notifications do not show headings when notified at the top of the screen

We use firebase push notification in Android and iOS. The click is sent using the REST API call. Type Push notification with optional data node.

Here is an example payload:

 { "notification" : { "title": "title text", "body": "message body text", "sound": "default" }, "data": { "messageType": "xxx" }, "to": "yyy", "priority": "high", "time_to_live": 0 } 

This type of push notification does not display the on-screen menu when the application is in the background and the phone is turned on. - The notification is only added to the notification panel, but is not hidden from the user at the top of the screen. - regardless of whether the current application is a full-screen application or not.

One solution that I tried and works is to go to a clean data message in which we will not send a notification node, but just a data node and write code to show a notification and prioritize Max notifications (i.e. .setPriority(Notification.PRIORITY_MAX) ) for the notification builder object. But this seems to have problems with iOS, where data only clicks are not accepted / displayed to the user if the application was killed by the user.

So is there any workaround? any solution that runs on Android but also does not disrupt iOS.

+5
source share

Source: https://habr.com/ru/post/1266595/


All Articles