I get an error when my package id is nil
2016-08-31 10: 39: 11.630 WeatherHop [52533: 17767791] * Application terminated due to an uncaught exception "NSInternalInconsistencyException", reason: "Invalid parameter that did not satisfy: bundleIdentifier! = Nil" * First stack of throw calls:
Cannot use this code:
let bundleIdentifier = Bundle.main.bundleIdentifier
print("\(bundleIdentifier)")
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in
if granted {
}....
the print statement correctly identifies my package identifier as set in $ (PRODUCT_BUNDLE_IDENTIFIER)
Any idea why I am getting this error?
source
share