File tree Expand file tree Collapse file tree 1 file changed +0
-12
lines changed
Expand file tree Collapse file tree 1 file changed +0
-12
lines changed Original file line number Diff line number Diff 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" ];
You can’t perform that action at this time.
0 commit comments