From bc67879f3a7a8e73da4010d50aca6610250ac546 Mon Sep 17 00:00:00 2001 From: Marcel Dierkes Date: Sat, 5 Jun 2021 09:21:22 +0200 Subject: [PATCH] Schedule notification requests without checking settings first --- .../KYAUserNotificationCenter.m | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/KYAKit/KYAUserNotificationCenter/KYAUserNotificationCenter.m b/KYAKit/KYAUserNotificationCenter/KYAUserNotificationCenter.m index 9fbb4d4e..4bab3b21 100644 --- a/KYAKit/KYAUserNotificationCenter/KYAUserNotificationCenter.m +++ b/KYAKit/KYAUserNotificationCenter/KYAUserNotificationCenter.m @@ -123,28 +123,8 @@ - (void)postNotification:(__kindof KYAUserNotification *)notification { NSParameterAssert(notification); - Auto center = self.center; - [center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings *settings) { - if(settings.authorizationStatus != UNAuthorizationStatusAuthorized - && settings.authorizationStatus != UNAuthorizationStatusProvisional) - { - KYALog(@"Posting notifications has not been authorized."); - return; - } - - if(settings.alertSetting == UNNotificationSettingEnabled) - { - Auto content = [notification createNotificationContent]; - Auto identifier = notification.identifier; - [self scheduleNotificationRequestWithIdentifier:identifier content:content]; - } - }]; -} - -- (void)scheduleNotificationRequestWithIdentifier:(NSString *)identifier content:(UNNotificationContent *)content -{ - NSParameterAssert(identifier); - NSParameterAssert(content); + Auto content = [notification createNotificationContent]; + Auto identifier = notification.identifier; Auto request = [UNNotificationRequest requestWithIdentifier:identifier content:content