• <small id='hjDum'></small><noframes id='hjDum'>

  • <i id='hjDum'><tr id='hjDum'><dt id='hjDum'><q id='hjDum'><span id='hjDum'><b id='hjDum'><form id='hjDum'><ins id='hjDum'></ins><ul id='hjDum'></ul><sub id='hjDum'></sub></form><legend id='hjDum'></legend><bdo id='hjDum'><pre id='hjDum'><center id='hjDum'></center></pre></bdo></b><th id='hjDum'></th></span></q></dt></tr></i><div id='hjDum'><tfoot id='hjDum'></tfoot><dl id='hjDum'><fieldset id='hjDum'></fieldset></dl></div>
    • <bdo id='hjDum'></bdo><ul id='hjDum'></ul>

    <legend id='hjDum'><style id='hjDum'><dir id='hjDum'><q id='hjDum'></q></dir></style></legend>

      1. <tfoot id='hjDum'></tfoot>

        如何使用 Firebase 将多个通知合并为一个?

        时间:2023-07-28
          <bdo id='yr5mK'></bdo><ul id='yr5mK'></ul>

              1. <legend id='yr5mK'><style id='yr5mK'><dir id='yr5mK'><q id='yr5mK'></q></dir></style></legend>

                <small id='yr5mK'></small><noframes id='yr5mK'>

              2. <i id='yr5mK'><tr id='yr5mK'><dt id='yr5mK'><q id='yr5mK'><span id='yr5mK'><b id='yr5mK'><form id='yr5mK'><ins id='yr5mK'></ins><ul id='yr5mK'></ul><sub id='yr5mK'></sub></form><legend id='yr5mK'></legend><bdo id='yr5mK'><pre id='yr5mK'><center id='yr5mK'></center></pre></bdo></b><th id='yr5mK'></th></span></q></dt></tr></i><div id='yr5mK'><tfoot id='yr5mK'></tfoot><dl id='yr5mK'><fieldset id='yr5mK'></fieldset></dl></div>
                  <tbody id='yr5mK'></tbody>
                <tfoot id='yr5mK'></tfoot>
                • 本文介绍了如何使用 Firebase 将多个通知合并为一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 Firebase Cloud Functions 中有一个函数,用于向我的应用程序中的特定用户发送通知,并且具有以下代码:

                  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 code:

                  const notificationContent = {
                      notification: {
                          title: "My Notification Title",
                          body: "My Notification Body",
                          icon: "default",
                          sound : "default"
                      }
                  };
                  

                  我曾尝试使用 collapse_key: "unique_key" 但没有效果.我阅读了仅在设备离线时才有效.我也使用了 tag: "unique" 但每次新通知到达时,它都会覆盖最旧的通知.

                  I have tried to use collapse_key: "unique_key" but it has no effect. I read the has an effect only when the device is offline. I also have used a tag: "unique" but every time a new notification arrives, it will override the oldest one.

                  我有什么方法可以通过 Firebase 实现这一目标?如果我收到多于一个通知,是否会被归为一个?

                  I there any way in which I can achieve this with Firebase? If I receive more then one notification, to be grouped in a single one?

                  提前致谢!

                  推荐答案

                  如果您想使用更多可定制和高级的通知功能.您应该只发送带有 data 有效负载的 FCM,并在 android 客户端创建通知.
                  请记住,如果您使用 notification 有效负载或 notification + data 有效负载发送 FCM,则通知将由 android 核心系统和 BroadcastReceiver 创建如果您的应用处于后台,则不会调用 onReceive 方法.
                  如果您发送带有 data 有效负载的 FCM,它将一直调用 onReceive,因此您可以在 android 客户端手动生成自定义通知.(大多数应用使用后一种方法.)

                  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.)

                  我希望此链接会有所帮助.

                  这篇关于如何使用 Firebase 将多个通知合并为一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Firebase 云消息传递令牌未生成 下一篇:FIrebase 云消息传递,无法解析依赖项 com.google.firebase:firebase-core:9.0

                  相关文章

                  <tfoot id='Rcy1Z'></tfoot>

                    <small id='Rcy1Z'></small><noframes id='Rcy1Z'>

                    <legend id='Rcy1Z'><style id='Rcy1Z'><dir id='Rcy1Z'><q id='Rcy1Z'></q></dir></style></legend>
                    <i id='Rcy1Z'><tr id='Rcy1Z'><dt id='Rcy1Z'><q id='Rcy1Z'><span id='Rcy1Z'><b id='Rcy1Z'><form id='Rcy1Z'><ins id='Rcy1Z'></ins><ul id='Rcy1Z'></ul><sub id='Rcy1Z'></sub></form><legend id='Rcy1Z'></legend><bdo id='Rcy1Z'><pre id='Rcy1Z'><center id='Rcy1Z'></center></pre></bdo></b><th id='Rcy1Z'></th></span></q></dt></tr></i><div id='Rcy1Z'><tfoot id='Rcy1Z'></tfoot><dl id='Rcy1Z'><fieldset id='Rcy1Z'></fieldset></dl></div>

                      <bdo id='Rcy1Z'></bdo><ul id='Rcy1Z'></ul>