Смотрите объявление
@available(iOS 10.0, *)
public struct UNNotificationPresentationOptions : OptionSet {
public init(rawValue: UInt)
public static var badge: UNNotificationPresentationOptions { get }
public static var sound: UNNotificationPresentationOptions { get }
public static var alert: UNNotificationPresentationOptions { get }
}
это типы разрешений .alert /.sound/.badge, вы не можете изменить подпись метода делегата на то, что вам нужно, ее главная цель - вернуть разрешенияэта система сработает для этого приходящего уведомления
//
Вы можете использовать службу уведомлений && расширение содержимого
Реализуйте свои правки здесь
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
if let bestAttemptContent = bestAttemptContent {
// Modify the notification content here...
bestAttemptContent.title = "\(bestAttemptContent.title) [modified]"
contentHandler(bestAttemptContent)
}
}