iOS Swift 3 Bundle Notification

╄→гoц情女王★ 提交于 2019-12-02 03:11:01

问题


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 it Possible to Receive Notification like whatsapp(You have 10 New Notification). If user receives more than 1 notification at a time means we need to make it as Group or Bundle notification.


回答1:


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


来源:https://stackoverflow.com/questions/42433644/ios-swift-3-bundle-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!