From bb20beef52bd21d5f75cd79d324aa53ff0d36b0e Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 5 Apr 2025 13:12:05 -0400 Subject: [PATCH] Request authorization for sending notifications --- Sources/App/Classes/Library/TLONotificationController.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/App/Classes/Library/TLONotificationController.m b/Sources/App/Classes/Library/TLONotificationController.m index a5bb87cfa..ffc463fce 100755 --- a/Sources/App/Classes/Library/TLONotificationController.m +++ b/Sources/App/Classes/Library/TLONotificationController.m @@ -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]; }