Skip to content

Support for Time-Sensitive notifications on iOS 15 #4

Description

@anagstef

Feature Request

Plugin

Local Notifications

Description

Support for Time-Sensitive notifications on iOS 15+. Time-Sensitive notifications allow the developer to schedule notifications that are important to bypass the Focus active mode or the system Do not disturb settings.

Platform(s)

iOS (15.0+)

Preferred Solution

We should add the new variable interruptionLevel inside the UNMutableNotificationContent. The interruptionLevel variable is an enum with the following values:

case passive = 0
The system adds the notification to the notification list without lighting up the screen or playing a sound.

case active = 1
The system presents the notification immediately, lights up the screen, and can play a sound.

case timeSensitive = 2
The system presents the notification immediately, lights up the screen, and can play a sound, but won’t break through system notification controls.

case critical = 3
The system presents the notification immediately, lights up the screen, and bypasses the mute switch to play a sound.

Maybe add an interface to be exported through capacitor so that developer can get these allowed values.

Also, developer must enable the correct value in App.entitlements for this to work:

<key>com.apple.developer.usernotifications.time-sensitive</key>
<true/>

The above should be added to the documentation too.

Additional Context

Overview:
https://developer.apple.com/videos/play/wwdc2021/10091/

Relevant apple docs:
https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent
https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent/3747253-interruptionlevel
https://developer.apple.com/documentation/usernotifications/unnotificationinterruptionlevel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions