2017-08-09 125 views
0

我知道苹果公司将本地通知数量限制在64个。在阅读Apple的文档后,在SO和博客上发布了一些帖子......我有点困惑。本地通知限制

它是:

  1. 您只能安排64所总通知的应用不断。
  2. 你不能有超过64个通知,安排在同一时间。(做 他们的fireDate后自动删除?
+0

为什么你不测试它? – Ryan

回答

1

设备上的每个应用程序被限制为64个安排本地通知(从服务器不通知)。

当你打开应用程序通知将复位,因此您可以在每次关闭应用程序的时间之后再派64。

系统将放弃计划通知超过此限制, 只保留最快会触发的64个通知。 重复性通知被视为单个通知。

为每个通知给出不同的“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"); 
    } 

}]; 
+0

你从哪里得到通知在您打开应用程序时重置的事实?实际情况并非如此。另外,请包括您的报价参考。您的代码位于Objective-C而不是Swift中,并且不能解决问题,单个应用程序无论标识符如何都只能有64个计划通知。 –