After porting my app to Swift 6 local notifications produce a sound, but no alert

My app produces local notification but unfortunately they only play a sound but do not produce an alert. Of course I requested authorization with:

let center = UNUserNotificationCenter.current()
        center.requestAuthorization(options: [.alert, .sound]) {(granted, error) in
        // Enable or disable features based on authorization.
        }

And scheduled the notification with:

func localNotification(_ title:String, message:String,  sound:UNNotificationSound?, badge:Int?,   interval:TimeInterval, userInfo: [AnyHashable : Any]?, category:UNNotificationCategory?=nil){
        let content = UNMutableNotificationContent()
        content.title = NSString.localizedUserNotificationString(forKey: title, arguments: nil)
        content.body = NSString.localizedUserNotificationString(forKey: message, arguments: nil)
        content.sound=sound
        let ti = NSInteger(interval)

        let seconds = ti % 60
        let minutes = (ti / 60) % 60
        let hours = (ti / 3600)
        //let ms = Int((interval.truncatingRemainder(dividingBy: 1)) * 1000)
        var dateInfo = DateComponents()
        
        dateInfo.hour=hours
        dateInfo.minute=minutes
        dateInfo.second=seconds
        let trigger = UNCalendarNotificationTrigger(dateMatching: dateInfo, repeats: false)
        let request = UNNotificationRequest(identifier: "EndOfMeditation", content: content, trigger: trigger)
        
        let center = UNUserNotificationCenter.current()
        center.delegate = self
        center.add(request) { (error : Error?) in
            if let theError = error {
                print(theError.localizedDescription)
            }
        }
    }

and have no queue about to know better.

To display an alert, you must populate the title and body properties of your UNMutableNotificationContent object. If these properties are empty, the system may only play the sound without displaying a visual alert.

You would want to check that the two strings you are passing to the function actually non-empty strings, and NSString.localizedUserNotificationString is not returning nil due to an error.

After porting my app to Swift 6 local notifications produce a sound, but no alert
 
 
Q