Crash by UNTimeIntervalNotificationTrigger with timeInterval=0

I just wanted to migrate to the newly available NotificationsFramework and wondered how to fire a Local Notification imediately.

I was trying it with a UNTimeIntervalNotificationTrigger setting its timeInterval property to 0 like mentioned in the WWDC session. However, my app crashes then saying that timeInterval needs to be greater than 0.


So, how to fire a local notification imediately with the new Framework?

Specify nil for the trigger when you create the UNNotificationRequest to deliver the notification immediately.

UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:@"error" content:content trigger:nil];

Oh wow. I tried to do it like they said in the WWDC session and I got a crash, of course. I filed a bug and weeks later they asked if it was still happening, and if so to send them a sysdiagnose… it was pretty clear from their response they barely looked at the report, and now I'm positive they didn't. I never considered there might be another way to do it. Thank you.

Crash by UNTimeIntervalNotificationTrigger with timeInterval=0
 
 
Q