Limit for Local Notifications (UNNotificationRequest) in iOS 10

三世轮回 提交于 2019-12-01 03:53:39

Although it's not officially documented, testing shows that UNNotificationRequest retains the 64 notification limit.

However, importantly, the way that they deal with the notification queue has changed. If there are more than 64 notifications:

  • 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.

Yes indeed, I just checked for iOS 10.2 and the limit for the total number of UNNotificationRequest you can add is still 64.

The IOS 12 version of UNNotificationCenter.h has in comments of (void)addNotificationRequest:(UNNotificationRequest *)request withCompletionHandler:(nullable void(^)(NSError *__nullable error))completionHandler; this:

Notification requests can be scheduled to notify the user via time and location. See UNNotificationTrigger for more information. Calling -addNotificationRequest: will replace an existing notification request with the same identifier. A notification request with the identifier as an existing delivered notifications will alert for the new notification request and replace the existing delivered notification when it is triggered. The number of pending notification requests that may be scheduled by an application at any one time is limited by the system.

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