Skip to content

Commit ea4989d

Browse files
committed
remove unneeded UNUserNotificationCenter requestAuthorizationWithOptions
1 parent a1918eb commit ea4989d

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

ios/Classes/FlutterAppBadgerPlugin.m

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,7 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
1010
[registrar addMethodCallDelegate:instance channel:channel];
1111
}
1212

13-
- (void)enableNotifications {
14-
if (@available(iOS 10, *)) {
15-
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
16-
[center requestAuthorizationWithOptions:(UNAuthorizationOptionAlert | UNAuthorizationOptionBadge | UNAuthorizationOptionSound) completionHandler:^(BOOL granted, NSError * _Nullable error){}];
17-
} else {
18-
UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:[[UIApplication sharedApplication] currentUserNotificationSettings].categories];
19-
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
20-
}
21-
}
22-
2313
- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
24-
[self enableNotifications];
25-
2614
if ([@"updateBadgeCount" isEqualToString:call.method]) {
2715
NSDictionary *args = call.arguments;
2816
NSNumber *count = [args objectForKey:@"count"];

0 commit comments

Comments
 (0)