When using NSString.localizedUserNotificationString(:_) with an argument, the system service responsible for user notifications fails.
[Connections] [REDACTED_BUNDLE_ID] Adding notification request failed with error: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.usernotifications.usernotificationservice" UserInfo={NSDebugDescription=connection to service namedIf the arguments argument is nil, this problem does not occur.
Localizable.strings
"notification_one" = "Here's a number: %D";
"notification_two" = "Hello";Swift
let notificationContentOne = UNMutableNotificationContent()
notificationContentOne.body = NSString.localizedUserNotificationString(forKey: "notification_one", arguments: [5])
UNUserNotificationCenter.current().add(notificationContentOne) // <-- Service error
let notificationContentTwo = UNMutableNotificationContent()
notificationContentTwo.body = NSString.localizedUserNotificationString(forKey: "notification_two", arguments: nil)
UNUserNotificationCenter.current().add(notificationContentTwo) // <-- No service errorTested on device and simulator (Xcode 10b5).