mirror of
https://github.com/Codeux-Software/Textual.git
synced 2026-06-16 13:24:32 +00:00
Request authorization for sending notifications
This commit is contained in:
@@ -94,6 +94,15 @@ NSString * const TXNotificationActionIdentifierLicenseManagerMoreInfo = @"TXNoti
|
||||
|
||||
[RZNotificationCenter() addObserver:self selector:@selector(mainWindowSelectionChanged:) name:TVCMainWindowSelectionChangedNotification object:nil];
|
||||
|
||||
[RZUserNotificationCenter() requestAuthorizationWithOptions:UNAuthorizationOptionAlert
|
||||
completionHandler:^(BOOL granted, NSError * _Nullable error) {
|
||||
if (error) {
|
||||
LogToConsoleError("Notifications failed to authorize: %{public}@", error.localizedDescription);
|
||||
}
|
||||
|
||||
LogToConsoleInfo("Notification permission: %{public}@", StringFromBOOL(granted));
|
||||
}];
|
||||
|
||||
[self registerCategories];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user