Skip to content

How to Enable Time Sensitive Notifications on iOS

Time Sensitive notifications were introduced in iOS 15, which can deliver information that demand immediate attention and directly call on the individual to take action in the moment they receive them.

Time Sensitive alerts are always delivered immediately, surfaced above other notifications, and allowed to break through Focus and Do Not Disturb

Step1: Enable Time Sensitive Notifications in App ID Configuration

  1. Login to your Apple Developr Account
  2. In the Certificates, Identifiers & Profiles section, Identifiers subsection, select your AppID.
  3. In the App ID Configuration page, enable Time Sensitive Notifications, click Save.
  4. If you have a NotificationService AppID, enable Time Sensitive Notifications too.
  5. Regenerate all the provision profiles related to the above AppIDs.

Time Sensitive Notificaitons appID configuration

Step2: Add Time Sensitive Notification Capability in Xcode Configuration

  1. Select your Main Target and Signing & Capabilities panel.
  2. Click the + Capability button.
  3. Select Time Sensitive Notifications capability.

Time Sensitive Notificaitons Xcode capability

Step3: Request Notification Permission in You App as Normal

  1. In your application's code, request push notificaiton permissions as your normally would. The .timeSensitive authorization option is not required.
swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    
    let authOptions: UNAuthorizationOptions = [.alert,.badge,.sound]
    UNUserNotificationCenter.current().requestAuthorization(options: authOptions) { (granted, error) in
        print(granted,error ?? "")
    }
    application.registerForRemoteNotifications()
    
    return true
}

func application(_ application: UIApplication,didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    let deviceTokenString = deviceToken.reduce("", { $0 + String(format: "%02X", $1) })
    print("APNs device token: \(deviceTokenString)")
}
  1. Following the running of the application and granting push notification permissions, users can access the app's notification settings page within the device's Settings application. There, they will find that the Time Sensitive Notificaitons toggle is enabled.
Time Sensitive Notificaitons Permission in App

Step4: Send a Time Sensitive Notification

The notification payload should include the filed "interruption-level"with the value "time-sensitive".

This payload can be sent using either the ApnsPush or your own push notification tool.

json
{
    "aps": {
        "alert": {
            "title": "Game Request3",
            "subtitle": "Five Card Draw",
            "body": "Bob wants to play poker"
        },
        "interruption-level": "time-sensitive"
    }
}

If all conditions are met, your application will receive a time-sensitive notificaiton like this.

Time Sensitive Notificaitons Example

Upon receiving the first time-sensitive notification, the system will prompt the user to adjust the Time Sensitive Notificaitons setting if desired.

Time Sensitive Notificaitons Example

Disabling Time Sensitive Notificaitons will cause them to be treated as standard notifications, which will not bypass Focus and Do Not Disturb settings.