作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在处理 ios 丰富的推送通知。如果 key (例如“notification_id”)在有效负载中相同,则想要用新收到的通知替换通知托盘中先前收到的通知。我已经尝试过“https://medium.com/the-guardian-mobile-innovation-lab/how-to-replace-the-content-of-an-ios-notification-2d8d93766446”中提到的解决方案,它适用于 ios 11 但不适用于 ios 12。
最佳答案
传递与您要替换的通知相同的 collapse_id。以下是 collapse_id
的说明Only one notification with the same id will be shown on the device. Use the same id to update an existing notification instead of showing a new one. Limit of 64 characters.
关于ios - 如何在 IOS 12 中用新收到的通知(包含相同的通知 ID)替换推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54004620/
我是一名优秀的程序员,十分优秀!