ntfy
ntfy copied to clipboard
iOS app doesn't properly handle "Critical" or "Time Sensitive" interruption levels
As discussed briefly on Discord, iOS 15 has particular mechanisms for handling "Time Sensitive" and "Critical" notifications. Time Sensitive can bypass focus modes, Critical bypasses silent mode.
The correct interruption levels are being set in https://github.com/binwiederhier/ntfy-ios/blob/main/ntfy/Utils/NotificationContent.swift#L54, aligned sensibly with priority 4 and 5, however neither of these are working natively on iOS.
For Time Sensitive the permission toggle doesn't appear in notification settings so the app isn't requesting permission to show them at all. It may just be a missing entitlement flag (see bottom of this Apple Developer forum threat - I've rebooted my device as suggested earlier in that thread to ensure that it's not that that's at fault.
If it's helpful context, a Time Sensitive notification should appear like this:
For Critical notifications, there's an Apple approval process (as you posted in Discord, this Medium article takes you through the steps required.
The Home Assistant app was ultimately granted entitlement for Critical Notifications, if it's useful, their rationale to Apple can be found here.
Again for context, a Critical notification would appear like this:
As I said last night on Discord, thanks so much for releasing an iOS app!
Thank you for the detailed bug report, especially for the link the the HA request text they used.
I will likely wait a bit for a few more iOS users (maybe 500 or so) before requesting the entitlement. Don't want to get denied because they think it's a super small app. There's usually only one shot at this.
Adding to this instead of creating a separate ticket just to provide some extra info for when the user base grows and this can be looked at again.
Background
In IOS, notifications can be sent with a special criticalAlert
priority which enables these alerts to bypass the users mute switch and Do Not Disturb settings. However, due to the disrupting nature of these notifications, Apple restricts the use of this priority and requires developers request a special entitlement (issued by Apple) and user setting authorization.
To be approved for this entitlement (I believe) one must reasonably state why such alerts are needed; consequently, it is imperative to highlight how these notifications will be limited to specific alerts, designated by the user, which are time sensitive, high urgency, and for serious events or something along those lines.
Current state / issue
Presently, when a message is published with the priority of 5 (.critical
) it does not act any different than one with a priority of 4 (.timeSensitive
) on the end user device alert-wise.
How to fix
The following 2 links document the steps required to enable this functionality.
- Stackoverflow question where both answers are helpful here.
- Medium article going over the steps similar to the link above here.
Example of an application that uses this feature
Here is an example of an application that uses the critical alert functionality.
Hi @binwiederhier, I hope that the number of users has increased significantly since June 2022 :-) Is there now a chance to request this entitlement? I would love to see real critical alerts on iOS.
+1 I also think this is a really must have. Because I miss the critical notification error I am seriously contemplating to write a kind of NTFY to HA parser. I love the way Ntfy is integrated with all kinds of open source notification systems, that really is amazing. However I use the critical notifications for a lot of things and I don't want multiple notification services. Keep up the really amazing work!
+1 this would be game changing for ntfy! Until then the alerts just don't really work for important senarios like engineers on-call, hopefully one day 👍 then we can get away from pushover
+1 I use critical alerts with other systems and it is ideal for overnight activations
+1
+1 is important for my company this critical notification, if i can for help update write me. thanks good app.