gpt4 book ai didi

ios - 关于如何进行 UNUserNotificationCenter 64 限制的问题

转载 作者:行者123 更新时间:2023-11-28 07:34:13 25 4
gpt4 key购买 nike

我正在尝试制作一个提醒应用,并且我所有的通知重复都设置为 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com