Application crashing in iOS 12.0 before iOS 12.0 it was working properly, I have googled it but did not get any solution for below crash log.
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key shouldAlwaysAlertWhileAppIsForeground.'
let content = UNMutableNotificationContent()
//App crash on below line
content.setValue(true, forKeyPath: "shouldAlwaysAlertWhileAppIsForeground")
Did anyone fix such kind of issues?
In iOS12 the
shouldAlwaysAlertWhileAppIsForeground
keyPath is removed and no longer supported.To achieve that on iOS12: