iOS 10中的本地通知限制(UNNotificationRequest)

Ant*_*pov 8 ios unnotificationrequest

我知道UILocalNotification的本地通知限制为64 .它是用Apple Dev Docs编写的.但UILocalNotification在iOS 10中已弃用.相反,Apple建议使用UNNotificationRequest.但Apple Dev Docs没有说明限制通知的数量.我找到了这个答案,但它没有Apple Dev Docs的链接或类似的东西(这只是一个意见).有没有人确切知道本地通知的限制?也许有人知道Dev Docs的链接,还是苹果对此有官方回应?

tea*_*cup 9

尽管没有正式记录,但测试表明UNNotificationRequest保留了 64 次通知限制。

然而,重要的是,他们处理通知队列的方式发生了变化。如果有超过 64 个通知:

  • UILocalNotification将保留 64 个最快的通知
  • UNNotificationRequest保留最后设置的 64通知

这可能是一个错误,并记录在此雷达中


Hor*_*rea 1

是的,确实如此,我刚刚检查了 iOS 10.2,您可以添加的 UNNotificationRequest 总数限制仍然是 64。

  • [UNNotificationRequest 的文档](https://developer.apple.com/documentation/usernotifications/unnotificationrequest) 没有提及它。[通知指南](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/index.html#//apple_ref/doc/uid/TP40008194-CH3-SW1)中也没有。你有官方消息来源提到它吗?我不怀疑限制的存在,但想看看它是否有记录。 (3认同)
  • @LukasSchulze 自 iOS 10 起,不推荐使用“UILocalNotification”。新类“UNNotificationRequest”提到对计划金额没有限制。 (3认同)