I'm using macOS Mojave and I switched from using NSUserNotification, which is now deprecated, to UNUserNotificationCenter. My app appears in System Preferences Notifications with a banner style selected (even though I specified it would use alerts via UNAuthorizationOptionAlert)
. Is the banner style always the default? I really want to start with an alerts style so the user can see the buttons that are available.Here's the code I used but it doesn't seem to effect any change in System Preferences Notifications -- it's still a banner.
// 03-27-2019 commented. has absolutely no effect on the notification appearing
UNAuthorizationOptions options = UNAuthorizationOptionAlert | UNAuthorizationOptionSound |
UNAuthorizationOptionBadge | UNAuthorizationOptionProvidesAppNotificationSettings;
[[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:options
completionHandler:^(BOOL granted, NSError * _Nullable error) {
if (!granted) {
NSLog(@"requestAuthorizationWithOptions: NO");
} else {
NSLog(@"requestAuthorizationWithOptions: YES");
[self createCategories];
}
}];