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

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

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

        FCM/GCM 通过“标签"对通知进行分组.在 iOS 上

        时间:2023-07-29
        <legend id='TFIP2'><style id='TFIP2'><dir id='TFIP2'><q id='TFIP2'></q></dir></style></legend>

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

                <bdo id='TFIP2'></bdo><ul id='TFIP2'></ul>
                  <i id='TFIP2'><tr id='TFIP2'><dt id='TFIP2'><q id='TFIP2'><span id='TFIP2'><b id='TFIP2'><form id='TFIP2'><ins id='TFIP2'></ins><ul id='TFIP2'></ul><sub id='TFIP2'></sub></form><legend id='TFIP2'></legend><bdo id='TFIP2'><pre id='TFIP2'><center id='TFIP2'></center></pre></bdo></b><th id='TFIP2'></th></span></q></dt></tr></i><div id='TFIP2'><tfoot id='TFIP2'></tfoot><dl id='TFIP2'><fieldset id='TFIP2'></fieldset></dl></div>
                • <tfoot id='TFIP2'></tfoot>
                    <tbody id='TFIP2'></tbody>
                  本文介绍了FCM/GCM 通过“标签"对通知进行分组.在 iOS 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  因此,在向 Android 设备发送通知时,您可以提供标签属性:

                  So, when sending a notification to an Android device you can give a tag property:

                  "notification": {
                      "title": title,
                      "body": message,
                      "sound": sound,
                      "tag": "STRING_TO_GROUP_NOTIFICATIONS_BY"
                  }
                  

                  这会将具有相同标签的通知组合在一起,这样它们就不会在用户通知很多时弄乱用户通知,并且只显示最新的通知.

                  This groups notifications with the same tag together so that they don't make a mess of the users notifications when there are a lot and only shows the newest one.

                  这在聊天应用程序中非常有用,它具有多个接收大量消息的频道,因此您可以按频道分组并最大限度地减少用户通知中的噪音.

                  This is really useful in say, a chat app, with multiple channels that receive lots of messages so you can group by channel and minimize the amount of noise in the user's notifications.

                  总是……

                  iOS 有什么方法可以做到这一点吗?

                  Is there any way to do this with iOS?

                  推荐答案

                  更新:apns-collapse-id 已经可用于 FCM v1:

                  Update: apns-collapse-id is already available for FCM v1:

                  FCM 为发送到 Android 设备的消息提供一组特定的传递选项,并允许在 iOS 和 Web 上提供类似选项.例如,Android 上通过 FCM 的 collapse_key 支持可折叠"消息行为,iOS 上通过 apns-collapse-id 支持,JavaScript/Web 上通过 Topic 支持.详见本节说明及相关参考文档

                  FCM provides a specific set of delivery options for messages sent to Android devices, and allows for similar options on iOS and web. For example, "collapsible" message behavior is supported on Android via FCM's collapse_key, on iOS via apns-collapse-id, and on JavaScript/Web via Topic. For details, see descriptions in this section and related reference documentation

                  <小时>

                  标签 参数目前仅支持 Android(您可能已经知道这就是您寻找 iOS 的原因),并且目前在 iOS 中没有对应的参数.


                  The tag parameter is currently only supported for Android (which you probably already know which is why you're looking for iOS) and there is currently no counterpart for it in iOS.

                  来自我的在这里回答:

                  为了在 iOS 中捆绑通知,您必须指定 thread-id:

                  In order to bundle notifications in iOS, you'll have to specify a thread-id:

                  为该键提供一个字符串值,该字符串值表示用于分组通知的特定于应用程序的标识符.系统在通知中心和其他系统界面中将具有相同线程标识符的通知分组在一起.对于本地通知,此键对应于 threadIdentifier 属性一个 href="https://developer.apple.com/reference/usernotifications/unnotificationcontent" rel="nofollow noreferrer">UNNotificationContent 对象.

                  Provide this key with a string value that represents the app-specific identifier for grouping notifications. The system groups notifications with the same thread identifier together in Notification Center and other system interfaces. For local notifications, this key corresponds to the threadIdentifier property of the UNNotificationContent object.

                  但是,FCM 中目前没有thread-id 的参数counterpart.您可以尝试做的是利用 data 消息负载并将 thread-id 指定为自定义键值对.

                  However, there is currently no parameter counterpart for thread-id in FCM. What you could try and do is make use of a data message payload and specify the thread-id as a custom key-value pair.

                  一些可能有用的帖子:

                  • https://stackoverflow.com/a/37621274/4625829
                  • iOS线程ID"不分组推送通知
                  • iOS 10 如何为远程通知设置 UNotificationContent 线程标识符

                  这篇关于FCM/GCM 通过“标签"对通知进行分组.在 iOS 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:单击 Fcm 通知时打开深层链接 url 下一篇:如何在用户注销时刷新 FCM 令牌?

                  相关文章

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

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

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

                    1. <small id='JjQzO'></small><noframes id='JjQzO'>