问题描述
我知道 UILocalNotification 的本地通知限制为64.它是用 Apple开发文档编写的.但是iOS 10中不推荐使用UILocalNotification.Apple建议使用 UNNotificationRequest .但是 Apple Dev Docs 并没有说要限制通知数量. 我发现了这个 answer ,但是它没有指向Apple Dev Docs或类似内容的链接(仅是一种意见). 谁能确切知道本地通知的限制? 也许有人知道与开发文档的链接,或者苹果对此有官方回应吗?
I know that the limit of local notifications is 64 for UILocalNotification. It's written in Apple Dev Docs. But UILocalNotification is deprecated in iOS 10. Instead this one, Apple proposes to use UNNotificationRequest. But Apple Dev Docs doesn't say anything about limiting the count of notifications. I found this answer, but it doesn't have links to Apple Dev Docs or something like that (it's just an opinion). Does anyone know for sure about restrictions of local notifications? Maybe someone know the link to Dev Docs or is there an official response from Apple about this?
推荐答案
尽管尚未正式记录,但测试表明,UNNotificationRequest
保留了64个通知限制.
Although it's not officially documented, testing shows that UNNotificationRequest
retains the 64 notification limit.
但是,重要的是,它们处理通知队列的方式已更改.如果通知超过64个:
However, importantly, the way that they deal with the notification queue has changed. If there are more than 64 notifications:
UILocalNotification
将保留64个最快通知
UNNotificationRequest
保留64个最后一组通知
UILocalNotification
would keep the 64 soonest notifications
UNNotificationRequest
keeps the 64 last set notifications
这可能是一个错误,并记录在此雷达中.
This may be a bug, and is documented in this radar.