gpt4 book ai didi

ios - 本地通知限制

转载 作者:行者123 更新时间:2023-11-28 15:23:26 25 4
gpt4 key购买 nike

我知道 Apple 将本地通知的数量限制为 64。在阅读了 Apple 的文档、SO 和博客上的一些帖子之后……我有点困惑。

是吗:

  1. 您总共只能为该应用安排 64 条通知。
  2. 一次不能安排超过 64 个通知。(做他们会在 fireDate 之后自动删除吗?

最佳答案

设备上的每个应用仅限于 64 个预定的本地通知(不是来自服务器的通知)。

通知会在您打开应用时重置,因此您可以在每次关闭应用后再次发送 64。

The system discards scheduled notifications in excess of this limit, keeping only the 64 notifications that will fire the soonest. Recurring notifications are treated as a single notification.

为每个通知提供不同的“requestWithIdentifier”并尝试,可能对您有用。

UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:@"youridentifier" content:objNotificationContent trigger:trigger];
UNUserNotificationCenter *userCenter = [UNUserNotificationCenter currentNotificationCenter];
[userCenter addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
if (!error) {
NSLog(@"Local Notification succeeded");
} else {
NSLog(@"Local Notification failed");
}

}];

关于ios - 本地通知限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45601375/

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