我正在尝试制作一个提醒应用程序,并且我所有的通知重复都设置为 true
Example :
var dateComponents = DateComponents()
dateComponents.weekday = 1
dateComponents.hour = Int(hour)
dateComponents.minute = Int(minute)
let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true)
let requestIdentifier = "\(timeArrayToSaveInMobile[indexTime].alarmId!)Sunday"
let request = UNNotificationRequest(identifier: requestIdentifier, content: content, trigger: trigger)
我浏览过这里,有些人提到系统保留了最快触发的 64 个通知。 因此,如果我已经达到限制,但我设置了另一个通知,该通知将早于(64 列表)中的某些通知触发,它应该替换其中一个通知,对吗?因为它会比列表中的一些预设通知更早触发。
我的问题与此类似ios 10 swift 3 add more than 64 local notifications does not keep soonest
最佳答案
当您打开应用程序时,通知将重置,因此您可以在每次关闭应用程序后设置/发送另一个 64。
系统会丢弃超出此限制的计划通知,仅保留最快触发的 64 个通知。重复通知被视为单个通知。
在您的示例中,您为星期日设置了一个通知,每个星期日仅计数一个。
关于ios - 关于如何处理 UNUserNotificationCenter 64 限制的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53701073/