2

I built a simple todo app based on the reminders app and EKEvent. Instead of setting an EKAlert for their due date, I built my own UNUserNotification, mainly because of custom action events I'd like to have. The code mainly follows the examples on this page: https://useyourloaf.com/blog/local-notifications-with-ios-10/

For testing, the app is also scheduling EKAlarms with the same parameters. Now if I test with 2 todo entries like this:

  • todo test 1, due date 10:00 am
  • todo test 2, due date 10:00 am

I get 2 UserNotifications and 2 EKAlarm reminders in notification center at 10am. Now my Problem:

  • If one of the EKAlarms is dismissed / acted upon, it disappears from notification center, while the other alarm stays there.
  • If one of the UNUserNotifications is dismissed / acted upon, all other notifications disappear as well from notification center.

I'd rather act on every todo on it's own: Some I want to dismiss, some to snooze, some to ignore altogether, all in notification center.

I tried:

  • attempting to check all options regarding notifications in iOS, particularly the app-specific ones
  • setting a unique external identifier as well as a unique UNNotificationCategory for each UserNotification, which had no effect - all notifications disappear regardless
  • googling if someone else has encountered this problem, but all I could find was complaints about older iOS versions NOT dismissing all notifications at once.

So is there a way to schedule multiple notifications from an app, but have the user dismiss every single one of them?

Thanks!

EDIT: this post suggests that the Problem is related to iOS 11 specifically. I think it describes my problem well, but way shorter :)

EDIT 2: This appears to be a problem with iOS 11.2.x. This radar: https://openradar.appspot.com/36019616 exactly describes my problem.

EDIT 3: As of iOS 11.2.6, the behaviour hasn't changed.

EDIT 4: No change of behaviour in iOS 11.3.

EDIT 5: No change in iOS 11.4.

EDIT 6: Finally! The iOS12 update "stacks" notifications together. I can now handle every single alert/reminder the app is firing.

user1840267
  • 408
  • 1
  • 5
  • 18
  • I confirm what is happening to you, and the other [thread](https://stackoverflow.com/questions/48108165/unusernotificationcenter-removealldeliverednotifications-not-working-in-ios-11-2) is talking about this. – Harry Ng Jan 17 '18 at 08:51
  • Harry Ng, thanks. For everyone else, check the comments in the question and the answer from cornr. There the discussion pivots from "can't dismiss all notifications from code" to "all notifications are dismissed when one is acted upon". – user1840267 Jan 18 '18 at 09:38
  • @user1840267 Have you solved your problem? I have read all materials I can find on the internet including the link in the comment, but with no luck. Thanks in advance! – fujianjin6471 Sep 20 '18 at 08:03
  • fujianjin, as my Edit 6 said: The problem solved itself with iOS 12. – user1840267 Oct 24 '18 at 15:59

1 Answers1

-1

Add some text to content.body:

content.body = 'Any text'
fujianjin6471
  • 5,168
  • 1
  • 36
  • 32