I could not find a solution for this and dumbfounded on this. I have this code :
UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert |
UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
[[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:authOptions
completionHandler:^(BOOL granted, NSError * _Nullable error) {
NSLog(@"%i %@",granted, error);
}];
and then it immediately gets into the call handler without showing the notification permission
2020-09-18 18:05:46.657991-0700 My App [404:9600] 0 Error Domain=UNErrorDomain Code=1 "Notifications are not allowed for this application" UserInfo={NSLocalizedDescription=Notifications are not allowed for this application}
What am i missing? The alert does not even popup.
NOTE: This same code works with no issues on iOS 13.x, on iOS 14 it immediately fails.