Regression: Heavy Delay of Push Notifications on iOS 18.1 beta (10s and more)

My app one sec uses push notifications to guide the user back to the app from a Screen Time Shield (screenshot attached).

On iOS 18.1, notifications are delivered with a delay of 10+ seconds, even though they are classified as time sensitive:

notificationContent.interruptionLevel = .timeSensitive
notificationContent.relevanceScore = 1.0

The notification trigger is nil, which according to the documentation should show the notification banner immediately:

var notificationTrigger: UNTimeIntervalNotificationTrigger? = nil

"The condition that causes the system to deliver the notification. Specify nil to deliver the notification right away."

In the sysdiagnose I have noticed that activity related to Apple Intelligence Priority classification delays the notification by 10 seconds ("UserNotificationsCore.IntelligenceActor"):

[create, [id=43C0-B333, time=2024-09-27 06:03:26, bundle=***.riedel.one-sec], Time elapsed=10.373 sec]: Timeout of 10.0 reached. Cancelling work.

[create, [id=43C0-B333, time=2024-09-27 06:03:26, bundle=***.riedel.one-sec], Time elapsed=10.377 sec]: Calling out to completion with failure(UserNotificationsCore.StepFailure.timedOut(exceeded: 10.0 seconds, summaryStatus: Optional(UserNotificationsServices.NotificationSummaryStatus.inferenceTimedOut), priorityStatus: Optional(UserNotificationsServices.NotificationPriorityStatus.inferenceTimedOut))) from 'scheduleTimeoutToPerform(after:for:)'

[create, [id=43C0-B333, time=2024-09-27 06:03:26, bundle=***.riedel.one-sec], Time elapsed=10.378 sec]: Step: UserNotificationsCore.IntelligenceActor, index: 0 exceeded 10.0 seconds

This seems like a bug to me, time sensitive notifications should be exempted from being analyzed for priority, especially if that comes at the cost of delaying notifications by 10 seconds.

Tracked in Radar: FB15255061

”Time sensitive” notifications, to me, mean ones that shouldn’t be delayed and put in a scheduled summary, and that should appear at the top of the list of Notifications, and nothing more. I want them to go through the AI prioritizer so that Intelligent Breakthrough can work and inform me of the “Maybe Important” notification I just received.

This is further reinforced by the fact that the User Notification framework documentation clearly states:

The system makes every attempt to deliver local and remote notifications in a timely manner, but delivery isn’t guaranteed. The PushKit framework offers a more timely delivery mechanism for specific types of notifications, such as those VoIP and watchOS complications use. For more information, see PushKit.

Since delivery isn’t guaranteed, I personally consider the delays being discussed in this thread to be insignificant. For applications like security applications where rapid timing is important, it seems that maybe PushKit should be used instead?

On a side note,, I don’t see in the documentation where setting UNTimeIntervalNotificationTrigger? = nil would be valid, e.g., according to https://developer.apple.com/documentation/usernotifications/untimeintervalnotificationtrigger

non-zero values for it are required. Shouldn’t this be using UNNotificationTrigger instead? e.g., from the example:


convenience init(
    identifier: String,
    content: UNNotificationContent,
    trigger: UNNotificationTrigger?
)

Probably doesn’t matter, since nil is nil, I guess.

I want them to go through the AI prioritizer

Thanks for sharing your thoughts, however the Developer Documentation specifically says that Time Sensitive Notifications break through Notification Summary and Focus:

Time Sensitive notifications are similar to active notifications, but can break through system controls such as Notification Summary and Focus.

About setting the trigger to nil causing undefined behavior, that’s completely wrong as well, as you can read in the documentation:

trigger: The condition that causes the system to deliver the notification. Specify nil to deliver the notification right away.

Again, thanks a lot for sharing your thoughts here, I’m specifically interested in the workaround you mentioned using PushKit. Could you share more details on this?

After further research, it turns out that my personal understanding of “time sensitive notifications“ is basically correct. Per the documentation, the distinguishing factor is not time, but rather the ability to break through system controls like Notification Summary (that’s why they appear at the top of the list like I mentioned.)

Time Sensitive notifications are similar to active notifications, but can break through system controls such as Notification Summary and Focus. The user can turn off the ability for time sensitive notification interruptions.

https://developer.apple.com/documentation/usernotifications/unnotificationinterruptionlevel/timesensitive/#:~:text=Time%20Sensitive%20notifications%20are%20similar%20to%20active%20notifications%2C%20but%20can%20break%20through%20system%20controls%20such%20as%20Notification%20Summary%20and%20Focus.%20The%20user%20can%20turn%20off%20the%20ability%20for%20time%20sensitive%20notification%20interruptions.

About setting the trigger to nil causing undefined behavior, that’s completely wrong as well, as you can read in the documentation:

trigger: The condition that causes the system to deliver the notification. Specify nil to deliver the notification right away.

My point was about the code setting the variable to type UNTimeIntervalNotificationTrigger rather than type UNNotificationTrigger - I don’t know the internals of Swift well enough to know if that makes a difference or not, hence my question (and comment that it probably doesn’t matter since nil is nil)

Time Sensitive Notifications break through Notification Summary and Focus:

Agreed. But “break through” means they appear, e.g., the “Maybe Important” alert in the Reduce Interruptions focus. I fully expect future versions of this, once personal context is available, to result in some Time Sensitive Notifications not breaking through because the AI will know that I care about Duo notifications, for example, during the day, but not while I’m at the theatre.

Re: PushKit — that was mentioned in the referenced section of the documentation. Not sure if it would be appropriate for your application or not. I could easily see a live activity being used for the sort of time critical user interaction I think you’re looking to do, if I understood correctly. E.g., I could see a live activity in my dynamic island with an open lock icon in green that turns red and closed to indicate the user needs to tap to go through that intervention, or something.

Regression: Heavy Delay of Push Notifications on iOS 18.1 beta (10s and more)
 
 
Q