How to collapse multiple notifications into a single one using Firebase?

后端 未结 3 1762
渐次进展
渐次进展 2021-01-25 12:30

I have function in Firebase Cloud Functions which is used to send notifications to specific users within my app and has as the notificationContent the following cod

3条回答
  •  后悔当初
    2021-01-25 13:05

    If you want to use more customizable and advanced notification features. You should only send FCM with data payload, and create notification at android client side.
    Remember that if you send FCM with notification payload or notification + data payload, the notification will be created by android core system and BroadcastReceiver's onReceive method won't being called if your app is on background.
    If you send FCM with data payload, it will call onReceive all the time, so you can produce custom notification manually at android client side. (most app uses latter method.)

    I hope this link would be helpful.

提交回复
热议问题