iOS本地通知和自动丢弃 - 不是最简单的解雇64

时间:2012-09-05 14:27:38

标签: ios uilocalnotification

因此,对于iOS本地通知,您有:

Each application on a device is limited to the soonest-firing 64 scheduled local
notifications. The operating system discards notifications that exceed this limit. It 
considers a recurring notification to be a single notification.

是否有一种简单的方法可以确定何时添加通知,当另一个通知被推出64-soonest范围时,被“丢弃”?是否需要手动循环遍历所有通知,并“猜测”触发最后一个通知,以确定哪些将被删除?

干杯

1 个答案:

答案 0 :(得分:0)

根据我的经验,本地通知是在fireDate订购的NSArray中返回的,所以你只需抓住最后一个。

NSArray *array = [[UIApplication sharedApplication] scheduledLocalNotifications];

UILocalNotification *willBeRemoved = [array lastObject];

希望有所帮助:)