1

I have a swift 2 app in which you can create entries in Core Data. Each entry will register a local notification.

The problem is the limit of 64 local notifications. Is there an way to solve this "problem" with the limitation?

tktsubota
  • 9,371
  • 3
  • 32
  • 40
GhostStack
  • 153
  • 1
  • 13
  • See e.g. [this obj-c repo](https://github.com/vangelov/VLDLocalNotificationsScheduler) circumventing the 64 notification limit by using queuing. Possibly you can make use of similar techniques in your Swift project. – dfrib Feb 20 '16 at 19:37

1 Answers1

2

Kind of (thanks @dfri). However, repeated notifications only count as one notification, but it appears that you have 64 completely independent notifications.

From the Local and Remote Notification Programming Guide:

Each app on a device is limited to 64 scheduled local notifications. 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.

The only semi-viable alternative is (see this repo):

  1. Hope that your users open your app within 64 notifications.
  2. Schedule remaining notifications.
tktsubota
  • 9,371
  • 3
  • 32
  • 40
  • 2
    I'd say point `2` above is viable enough to _"solve this "problem" with the notification"_, so a set-in-stone _"Nope"_ is not really the case here. See e.g. [this obj-c repo](https://github.com/vangelov/VLDLocalNotificationsScheduler) circumventing the 64 notification limit by using queuing (which I believe, is a fully viable solution). – dfrib Feb 20 '16 at 19:36
  • or is there any way to register the next notification after the first one was showing ? – GhostStack Feb 20 '16 at 19:37
  • @dfri Nice, I'll change it to "kind of" :) – tktsubota Feb 20 '16 at 19:37
  • @GhostStack The notifications are copied to the system so there is no way to simply run some code once a notification fires. – tktsubota Feb 20 '16 at 19:38
  • is there an swift solution by using queuing ? – GhostStack Feb 20 '16 at 19:40
  • @GhostStack You can call objective-c code from swift. – tktsubota Feb 20 '16 at 19:41
  • but i need a swift solution :/ – GhostStack Feb 20 '16 at 20:48
  • @GhostStack If you want a swift solution, then you'll have to build a custom one yourself. – tktsubota Feb 20 '16 at 20:52
  • sry i dont understand this with the queue. how can i put my notifications into a queue, and how will it works that the notifications will be shown step by step? – GhostStack Feb 21 '16 at 08:55
  • @GhostStack Ask a separate question. – tktsubota Feb 21 '16 at 17:20
  • Apple link broken. Here's [the link](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/index.html#//apple_ref/doc/uid/TP40008194-CH3-SW1) but I'm not seeing the source of the quotation. [UILocalNotification](https://developer.apple.com/documentation/uikit/uilocalnotification) mentions it but that is deprecated now. – shim Aug 17 '17 at 19:27
  • See [this question](https://stackoverflow.com/questions/43424044/limit-for-local-notifications-unnotificationrequest-in-ios-10) – shim Aug 17 '17 at 19:36
  • @shim One of the Apple developers at the notifications lab at WWDC did say the limit is still in place. You could also try making a demo app to confirm that's still the case. – tktsubota Aug 17 '17 at 19:38
  • Mostly concerned about the lack of documentation. Was this a recorded WWDC talk? – shim Aug 17 '17 at 19:39
  • @shim No it was at one of the labs. – tktsubota Aug 17 '17 at 19:41