iOS Swift 3 捆绑通知
iOS Swift 3 Bundle Notification
在我的应用程序中,我正在使用 firebase 推送通知。问题是当用户长时间连接到互联网时,他们会收到大量通知作为个人通知。是否可以像 whatsapp 一样接收通知(您有 10 个新通知)。如果用户一次收到超过 1 个通知意味着我们需要将其作为组或捆绑通知。
更新:apns-collapse-id
已可用于 FCM v1:
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
为了在 iOS 中 捆绑 通知,您必须指定 thread-id
:
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
指定为自定义键值对。
一些可能有用的帖子:
- iOS 10 How to set UNotificationContent threadIdentifier for remote notification
在我的应用程序中,我正在使用 firebase 推送通知。问题是当用户长时间连接到互联网时,他们会收到大量通知作为个人通知。是否可以像 whatsapp 一样接收通知(您有 10 个新通知)。如果用户一次收到超过 1 个通知意味着我们需要将其作为组或捆绑通知。
更新:apns-collapse-id
已可用于 FCM v1:
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
为了在 iOS 中 捆绑 通知,您必须指定 thread-id
:
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
指定为自定义键值对。
一些可能有用的帖子:
- iOS 10 How to set UNotificationContent threadIdentifier for remote notification