iOS Swift 3 Bundle Notification

后端 未结 1 1047
Happy的楠姐
Happy的楠姐 2021-01-23 02:03

In My App I am using firebase push notification. Problem is when user connected to internet after long time they will receive lot of notifications as individual notification. Is

1条回答
  •  余生分开走
    2021-01-23 02:37

    Update: apns-collapse-id is already available for 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


    In order to bundle notifications in iOS, you'll have to specify a 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.

    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.

    Some possibly helpful posts:

    • https://stackoverflow.com/a/37621274/4625829
    • iOS "thread-id" doesn't group push notifications
    • iOS 10 How to set UNotificationContent threadIdentifier for remote notification

    0 讨论(0)
提交回复
热议问题