07-19-2023, 12:48 AM
Hello I am trying to display some notification datas.
In my notification I have a notification id to react deferently based on the pushed information.
I just cannot see what are those new UNNotificationPresentationOptions.
in my
userNotificationCenter(_: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void)
I have
if notification.request.content.userInfo[keyName] as? String == "someId" {
// Bla bla stuffs
if #available(iOS 14.0, *) {
completionHandler([.list, .banner, .sound])
} else {
completionHandler([.alert])
}
} else if ...
But when using [.banner] or [.list] or [.banner, .list] (without .alert) I just got nothing in foreground. In an ideal world I'd love to have the notification listed in the Notification center and display relevant information in my app (before calling completion handler).
Am I using thoses options right ?
In my notification I have a notification id to react deferently based on the pushed information.
I just cannot see what are those new UNNotificationPresentationOptions.
in my
userNotificationCenter(_: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void)
I have
if notification.request.content.userInfo[keyName] as? String == "someId" {
// Bla bla stuffs
if #available(iOS 14.0, *) {
completionHandler([.list, .banner, .sound])
} else {
completionHandler([.alert])
}
} else if ...
But when using [.banner] or [.list] or [.banner, .list] (without .alert) I just got nothing in foreground. In an ideal world I'd love to have the notification listed in the Notification center and display relevant information in my app (before calling completion handler).
Am I using thoses options right ?