# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1589518497 0 # Node ID b7514ecd6305811ef91b72a8fb255400727056e0 # Parent c2f13c5eefac6612b51ea23b7154b29099108b45 Mac: Minor changes to get notification permission. diff -r c2f13c5eefac -r b7514ecd6305 mac/dw.m --- a/mac/dw.m Fri May 15 02:13:57 2020 +0000 +++ b/mac/dw.m Fri May 15 04:54:57 2020 +0000 @@ -12086,12 +12086,16 @@ #ifdef BUILDING_FOR_MOJAVE if (@available(macOS 10.14, *)) { - [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:UNAuthorizationOptionAlert - completionHandler:^(BOOL granted, NSError * _Nullable error) { - if (!granted) { - NSLog(@"Unable to get notification permission."); - } - }]; + UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; + if(center) + { + [center requestAuthorizationWithOptions:UNAuthorizationOptionAlert|UNAuthorizationOptionSound + completionHandler:^(BOOL granted, NSError * _Nullable error) { + if (!granted) { + NSLog(@"WARNING: Unable to get notification permission."); + } + }]; + } } _DWDirtyDrawables = [[NSMutableArray alloc] init]; #else