Notification Permission Issue in Device Activity Report Extension (iOS 26)

I'm facing a problem where notification permissions are working fine in the main app, but failing in the Device Activity Report Extension on iOS 26. This issue wasn’t present in earlier iOS versions. Despite having notification permissions granted in the main app, the extension fails to get authorization. iOS 26: "

Before iOS 26:

Function call:

showNotification( title: "Screen Time", body: "Time: (Date().formatted(.dateTime.hour().minute().second()))", timeInterval: 1, isTimeSensitive: true )

Code:

func showNotification(title: String, body: String, timeInterval: Double, isTimeSensitive: Bool, widgetName: String? = nil, pageIndex: Int? = nil) {
    UNUserNotificationCenter.current().getNotificationSettings { settings in
        if settings.authorizationStatus == .authorized {
            let content = UNMutableNotificationContent()
            content.title = title
            content.body = body
            content.sound = UNNotificationSound.default

            // Add category identifier for tap handling
            content.categoryIdentifier = "ULTRAMIND_NOTIFICATION"

            // Add user info for navigation context if provided
            if let widgetName = widgetName, let pageIndex = pageIndex {
                // pageIndex: 0 = HomeTab, 1 = LeftBrain tab, 2 = HomeTab (main), 3 = RightBrain tab
                // widgetName: identifier for which bottom sheet to open (lowercase)
                content.userInfo = [
                    "widgetName": widgetName.lowercased(),  // Convert to lowercase
                    "pageIndex": pageIndex
                ]
            }

            if(isTimeSensitive){
                content.interruptionLevel = .timeSensitive
            }

            let trigger = UNTimeIntervalNotificationTrigger(timeInterval: timeInterval, repeats: false)
            let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: trigger)
            UNUserNotificationCenter.current().add(request) { error in
                if let error = error {
                    // print("Error showing termination notification: \(error)")
                }
            }
        }
    }
}
Notification Permission Issue in Device Activity Report Extension (iOS 26)
 
 
Q