Kaynağa Gözat

Fix ARC issues (handlers released too soon)

Mathieu Acthernoene 5 yıl önce
ebeveyn
işleme
9eb1f4fdea

+ 3
- 2
ios/FaceID/RNPermissionHandlerFaceID.m Dosyayı Görüntüle

@@ -45,7 +45,7 @@
45 45
       return resolve(RNPermissionStatusNotAvailable);
46 46
     }
47 47
 
48
-    if (![RNPermissions hasAlreadyBeenRequested:self]) {
48
+    if (![RNPermissions isFlaggedAsRequested:[[self class] handlerUniqueId]]) {
49 49
       return resolve(RNPermissionStatusNotDetermined);
50 50
     }
51 51
 
@@ -93,7 +93,7 @@
93 93
                       reply:^(__unused BOOL success, __unused NSError * _Nullable error) {}];
94 94
 
95 95
     // Hack to invalidate FaceID verification immediately after being requested
96
-    [self performSelector:@selector(invalidateContext) withObject:self afterDelay:0.015];
96
+    [self performSelector:@selector(invalidateContext) withObject:self afterDelay:0.05];
97 97
   } else {
98 98
     resolve(RNPermissionStatusNotAvailable);
99 99
   }
@@ -109,6 +109,7 @@
109 109
                                                   name:UIApplicationDidBecomeActiveNotification
110 110
                                                 object:nil];
111 111
 
112
+  [RNPermissions flagAsRequested:[[self class] handlerUniqueId]];
112 113
   [self checkWithResolver:_resolve rejecter:_reject];
113 114
 }
114 115
 

+ 2
- 1
ios/LocationAlways/RNPermissionHandlerLocationAlways.m Dosyayı Görüntüle

@@ -63,7 +63,7 @@
63 63
   _initialChangeEventFired = false;
64 64
   _isWaitingDidBecomeActive = false;
65 65
 
66
-  if (status == kCLAuthorizationStatusAuthorizedWhenInUse && ![RNPermissions hasAlreadyBeenRequested:self]) {
66
+  if (status == kCLAuthorizationStatusAuthorizedWhenInUse && ![RNPermissions isFlaggedAsRequested:[[self class] handlerUniqueId]]) {
67 67
     _isWaitingDidBecomeActive = true;
68 68
 
69 69
     [[NSNotificationCenter defaultCenter] addObserver:self
@@ -77,6 +77,7 @@
77 77
 }
78 78
 
79 79
 - (void)onAuthorizationStatus {
80
+  [RNPermissions flagAsRequested:[[self class] handlerUniqueId]];
80 81
   [self checkWithResolver:_resolve rejecter:_reject];
81 82
 
82 83
   [_locationManager setDelegate:nil];

+ 3
- 1
ios/Motion/RNPermissionHandlerMotion.m Dosyayı Görüntüle

@@ -38,7 +38,7 @@
38 38
     }
39 39
   }
40 40
 
41
-  if (![RNPermissions hasAlreadyBeenRequested:self]) {
41
+  if (![RNPermissions isFlaggedAsRequested:[[self class] handlerUniqueId]]) {
42 42
     return resolve(RNPermissionStatusNotDetermined);
43 43
   }
44 44
 
@@ -73,6 +73,8 @@
73 73
 
74 74
     self->_operationQueue = nil;
75 75
     self->_activityManager = nil;
76
+
77
+    [RNPermissions flagAsRequested:[[self class] handlerUniqueId]];
76 78
   }];
77 79
 }
78 80
 

+ 9
- 2
ios/Notifications/RNPermissionHandlerNotifications.h Dosyayı Görüntüle

@@ -1,7 +1,14 @@
1 1
 #import "RNPermissions.h"
2 2
 
3
-@interface RNPermissionHandlerNotifications : NSObject<RNPermissionHandler, RNPermissionWithRequestOptions>
3
+@interface RNPermissionHandlerNotifications : NSObject
4 4
 
5
-- (void)getSettingsWithResolver:(void (^ _Nonnull)(NSDictionary * _Nonnull settings))resolve;
5
++ (NSString * _Nonnull)handlerUniqueId;
6
+
7
+- (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus status, NSDictionary * _Nonnull settings))resolve
8
+                 rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject;
9
+
10
+- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus status, NSDictionary * _Nonnull settings))resolve
11
+                   rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject
12
+                    options:(NSArray<NSString *> * _Nonnull)options;
6 13
 
7 14
 @end

+ 75
- 93
ios/Notifications/RNPermissionHandlerNotifications.m Dosyayı Görüntüle

@@ -5,61 +5,85 @@
5 5
 
6 6
 @interface RNPermissionHandlerNotifications()
7 7
 
8
-@property (nonatomic, strong) void (^resolve)(RNPermissionStatus status);
8
+@property (nonatomic, strong) void (^resolve)(RNPermissionStatus status, NSDictionary * _Nonnull settings);
9 9
 @property (nonatomic, strong) void (^reject)(NSError *error);
10 10
 
11 11
 @end
12 12
 
13 13
 @implementation RNPermissionHandlerNotifications
14 14
 
15
-+ (NSArray<NSString *> * _Nonnull)usageDescriptionKeys {
16
-  return @[];
17
-}
18
-
19 15
 + (NSString * _Nonnull)handlerUniqueId {
20 16
   return @"ios.permission.NOTIFICATIONS";
21 17
 }
22 18
 
23
-- (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
24
-                 rejecter:(void (__unused ^ _Nonnull)(NSError * _Nonnull))reject {
19
+- (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus status, NSDictionary * _Nonnull settings))resolve
20
+                 rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject {
25 21
   if (@available(iOS 10.0, *)) {
26
-    UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
22
+    [[UNUserNotificationCenter currentNotificationCenter] getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
23
+      NSMutableDictionary *result = [NSMutableDictionary new];
24
+
25
+      bool alert = settings.alertSetting == UNNotificationSettingEnabled;
26
+      bool badge = settings.badgeSetting == UNNotificationSettingEnabled;
27
+      bool sound = settings.soundSetting == UNNotificationSettingEnabled;
28
+      bool lockScreen = settings.lockScreenSetting == UNNotificationSettingEnabled;
29
+      bool carPlay = settings.carPlaySetting == UNNotificationSettingEnabled;
30
+
31
+      if (settings.alertSetting != UNNotificationSettingNotSupported)
32
+        [result setValue:@(alert) forKey:@"alert"];
33
+      if (settings.badgeSetting != UNNotificationSettingNotSupported)
34
+        [result setValue:@(badge) forKey:@"badge"];
35
+      if (settings.soundSetting != UNNotificationSettingNotSupported)
36
+        [result setValue:@(sound) forKey:@"sound"];
37
+      if (settings.lockScreenSetting != UNNotificationSettingNotSupported)
38
+        [result setValue:@(lockScreen) forKey:@"lockScreen"];
39
+      if (settings.carPlaySetting != UNNotificationSettingNotSupported)
40
+        [result setValue:@(carPlay) forKey:@"carPlay"];
41
+
42
+      if (@available(iOS 12.0, *)) {
43
+        bool criticalAlert = settings.criticalAlertSetting == UNNotificationSettingEnabled;
44
+
45
+        if (settings.criticalAlertSetting != UNNotificationSettingNotSupported)
46
+          [result setValue:@(criticalAlert) forKey:@"criticalAlert"];
47
+      }
27 48
 
28
-    [center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
29 49
       switch (settings.authorizationStatus) {
30 50
         case UNAuthorizationStatusNotDetermined:
31 51
 #ifdef __IPHONE_12_0
32 52
         case UNAuthorizationStatusProvisional:
33 53
 #endif
34
-          return resolve(RNPermissionStatusNotDetermined);
54
+          return resolve(RNPermissionStatusNotDetermined, result);
35 55
         case UNAuthorizationStatusDenied:
36
-          return resolve(RNPermissionStatusDenied);
56
+          return resolve(RNPermissionStatusDenied, result);
37 57
         case UNAuthorizationStatusAuthorized:
38
-          return resolve(RNPermissionStatusAuthorized);
58
+          return resolve(RNPermissionStatusAuthorized, result);
39 59
       }
40 60
     }];
41 61
   } else {
42 62
     UIUserNotificationSettings *settings = [[UIApplication sharedApplication] currentUserNotificationSettings];
63
+    UIUserNotificationType types = [settings types];
43 64
 
44
-    if ([settings types] != UIUserNotificationTypeNone) {
45
-      return resolve(RNPermissionStatusAuthorized);
46
-    } else if ([RNPermissions hasAlreadyBeenRequested:self]) {
47
-      return resolve(RNPermissionStatusDenied);
65
+    NSDictionary *result = @{
66
+      @"alert": @((bool)(types & UIUserNotificationTypeAlert)),
67
+      @"badge": @((bool)(types & UIUserNotificationTypeBadge)),
68
+      @"sound": @((bool)(types & UIUserNotificationTypeSound)),
69
+    };
70
+
71
+    if (types != UIUserNotificationTypeNone) {
72
+      return resolve(RNPermissionStatusAuthorized, result);
73
+    } else if ([RNPermissions isFlaggedAsRequested:[[self class] handlerUniqueId]]) {
74
+      return resolve(RNPermissionStatusDenied, result);
48 75
     } else {
49
-      return resolve(RNPermissionStatusNotDetermined);
76
+      return resolve(RNPermissionStatusNotDetermined, result);
50 77
     }
51 78
   }
52 79
 }
53 80
 
54
-- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
55
-                   rejecter:(void (^ _Nonnull)(NSError * _Nonnull))reject {
56
-  NSArray<NSString *> *options = [[NSArray alloc] initWithObjects:@"alert", @"badge", @"sound", nil];
57
-  [self requestWithResolver:resolve rejecter:reject options:options];
58
-}
59
-
60
-- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
61
-                   rejecter:(void (^ _Nonnull)(NSError * _Nonnull))reject
81
+- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus status, NSDictionary * _Nonnull settings))resolve
82
+                   rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject
62 83
                     options:(NSArray<NSString *> * _Nonnull)options {
84
+  _resolve = resolve;
85
+  _reject = reject;
86
+
63 87
   bool alert = [options containsObject:@"alert"];
64 88
   bool badge = [options containsObject:@"badge"];
65 89
   bool sound = [options containsObject:@"sound"];
@@ -86,45 +110,46 @@
86 110
       types += UNAuthorizationOptionSound;
87 111
     }
88 112
 
89
-    UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
90
-
91
-    [center requestAuthorizationWithOptions:types
92
-                          completionHandler:^(BOOL granted, NSError * _Nullable error) {
113
+    [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:types
114
+                                                                        completionHandler:^(BOOL granted, NSError * _Nullable error) {
93 115
       if (error != nil) {
94 116
         return reject(error);
95 117
       }
118
+
96 119
       if (granted) {
97 120
         dispatch_async(dispatch_get_main_queue(), ^{
98 121
           [[UIApplication sharedApplication] registerForRemoteNotifications];
99 122
         });
100 123
       }
101 124
 
102
-      [self checkWithResolver:resolve rejecter:reject];
125
+      [RNPermissions flagAsRequested:[[self class] handlerUniqueId]];
126
+      [self checkWithResolver:self->_resolve rejecter:self->_reject];
103 127
     }];
104 128
   } else {
105
-    UIUserNotificationType types = UIUserNotificationTypeNone;
106
-
107
-    if (alert) types += UIUserNotificationTypeAlert;
108
-    if (badge) types += UIUserNotificationTypeBadge;
109
-    if (sound) types += UIUserNotificationTypeSound;
129
+    if ([RNPermissions isFlaggedAsRequested:[[self class] handlerUniqueId]]) {
130
+      [self checkWithResolver:_resolve rejecter:_reject];
131
+    } else {
132
+      UIUserNotificationType types = UIUserNotificationTypeNone;
110 133
 
111
-    if (!alert && !badge && !sound) {
112
-      types += UIUserNotificationTypeAlert;
113
-      types += UIUserNotificationTypeBadge;
114
-      types += UIUserNotificationTypeSound;
115
-    }
134
+      if (alert) types += UIUserNotificationTypeAlert;
135
+      if (badge) types += UIUserNotificationTypeBadge;
136
+      if (sound) types += UIUserNotificationTypeSound;
116 137
 
117
-    _resolve = resolve;
118
-    _reject = reject;
138
+      if (!alert && !badge && !sound) {
139
+        types += UIUserNotificationTypeAlert;
140
+        types += UIUserNotificationTypeBadge;
141
+        types += UIUserNotificationTypeSound;
142
+      }
119 143
 
120
-    [[NSNotificationCenter defaultCenter] addObserver:self
121
-                                            selector:@selector(onApplicationDidBecomeActive)
122
-                                                name:UIApplicationDidBecomeActiveNotification
123
-                                              object:nil];
144
+      [[NSNotificationCenter defaultCenter] addObserver:self
145
+                                               selector:@selector(onApplicationDidBecomeActive)
146
+                                                   name:UIApplicationDidBecomeActiveNotification
147
+                                                 object:nil];
124 148
 
125
-    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
126
-    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
127
-    [[UIApplication sharedApplication] registerForRemoteNotifications];
149
+      UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
150
+      [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
151
+      [[UIApplication sharedApplication] registerForRemoteNotifications];
152
+    }
128 153
   }
129 154
 }
130 155
 
@@ -133,51 +158,8 @@
133 158
                                                   name:UIApplicationDidBecomeActiveNotification
134 159
                                                 object:nil];
135 160
 
161
+  [RNPermissions flagAsRequested:[[self class] handlerUniqueId]];
136 162
   [self checkWithResolver:_resolve rejecter:_reject];
137 163
 }
138 164
 
139
-- (void)getSettingsWithResolver:(void (^ _Nonnull)(NSDictionary * _Nonnull settings))resolve {
140
-  if (@available(iOS 10.0, *)) {
141
-    UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
142
-
143
-    [center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
144
-      NSMutableDictionary *result = [NSMutableDictionary new];
145
-
146
-      bool alert = settings.alertSetting == UNNotificationSettingEnabled;
147
-      bool badge = settings.badgeSetting == UNNotificationSettingEnabled;
148
-      bool sound = settings.soundSetting == UNNotificationSettingEnabled;
149
-      bool lockScreen = settings.lockScreenSetting == UNNotificationSettingEnabled;
150
-      bool carPlay = settings.carPlaySetting == UNNotificationSettingEnabled;
151
-
152
-      if (settings.alertSetting != UNNotificationSettingNotSupported)
153
-        [result setValue:@(alert) forKey:@"alert"];
154
-      if (settings.badgeSetting != UNNotificationSettingNotSupported)
155
-        [result setValue:@(badge) forKey:@"badge"];
156
-      if (settings.soundSetting != UNNotificationSettingNotSupported)
157
-        [result setValue:@(sound) forKey:@"sound"];
158
-      if (settings.lockScreenSetting != UNNotificationSettingNotSupported)
159
-        [result setValue:@(lockScreen) forKey:@"lockScreen"];
160
-      if (settings.carPlaySetting != UNNotificationSettingNotSupported)
161
-        [result setValue:@(carPlay) forKey:@"carPlay"];
162
-
163
-      if (@available(iOS 12.0, *)) {
164
-        bool criticalAlert = settings.criticalAlertSetting == UNNotificationSettingEnabled;
165
-
166
-        if (settings.criticalAlertSetting != UNNotificationSettingNotSupported)
167
-          [result setValue:@(criticalAlert) forKey:@"criticalAlert"];
168
-      }
169
-
170
-      resolve(result);
171
-    }];
172
-  } else {
173
-    UIUserNotificationType types = [[[UIApplication sharedApplication] currentUserNotificationSettings] types];
174
-
175
-    resolve(@{
176
-      @"alert": @((bool)(types & UIUserNotificationTypeAlert)),
177
-      @"badge": @((bool)(types & UIUserNotificationTypeBadge)),
178
-      @"sound": @((bool)(types & UIUserNotificationTypeSound)),
179
-    });
180
-  }
181
-}
182
-
183 165
 @end

+ 3
- 11
ios/RNPermissions.h Dosyayı Görüntüle

@@ -77,19 +77,11 @@ typedef enum {
77 77
 
78 78
 @end
79 79
 
80
-@protocol RNPermissionWithRequestOptions <NSObject>
81
-
82
-@required
83
-
84
-- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus status))resolve
85
-                   rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject
86
-                    options:(NSArray<NSString *> * _Nonnull)options;
87
-
88
-@end
89
-
90 80
 @interface RNPermissions : NSObject <RCTBridgeModule>
91 81
 
92
-+ (bool)hasAlreadyBeenRequested:(id<RNPermissionHandler> _Nonnull)handler;
82
++ (bool)isFlaggedAsRequested:(NSString * _Nonnull)handlerId;
83
+
84
++ (void)flagAsRequested:(NSString * _Nonnull)handlerId;
93 85
 
94 86
 + (bool)isBackgroundModeEnabled:(NSString * _Nonnull)mode;
95 87
 

+ 28
- 22
ios/RNPermissions.m Dosyayı Görüntüle

@@ -225,27 +225,26 @@ RCT_EXPORT_MODULE();
225 225
   }
226 226
 }
227 227
 
228
-+ (void)setRequested:(id<RNPermissionHandler> _Nonnull)handler {
228
++ (bool)isFlaggedAsRequested:(NSString * _Nonnull)handlerId {
229
+  NSArray<NSString *> *requested = [[NSUserDefaults standardUserDefaults] arrayForKey:SETTING_KEY];
230
+  return requested == nil ? false : [requested containsObject:handlerId];
231
+}
232
+
233
++ (void)flagAsRequested:(NSString * _Nonnull)handlerId {
229 234
   NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
230
-  NSString *handlerUniqueId = [[handler class] handlerUniqueId];
231 235
   NSMutableArray *requested = [[userDefaults arrayForKey:SETTING_KEY] mutableCopy];
232 236
 
233 237
   if (requested == nil) {
234 238
     requested = [NSMutableArray new];
235 239
   }
236 240
 
237
-  if (![requested containsObject:handlerUniqueId]) {
238
-    [requested addObject:handlerUniqueId];
241
+  if (![requested containsObject:handlerId]) {
242
+    [requested addObject:handlerId];
239 243
     [userDefaults setObject:requested forKey:SETTING_KEY];
240 244
     [userDefaults synchronize];
241 245
   }
242 246
 }
243 247
 
244
-+ (bool)hasAlreadyBeenRequested:(id<RNPermissionHandler> _Nonnull)handler {
245
-  NSArray<NSString *> *requested = [[NSUserDefaults standardUserDefaults] arrayForKey:SETTING_KEY];
246
-  return requested == nil ? false : [requested containsObject:[[handler class] handlerUniqueId]];
247
-}
248
-
249 248
 + (bool)isBackgroundModeEnabled:(NSString * _Nonnull)mode {
250 249
   NSArray *modes = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIBackgroundModes"];
251 250
   return [modes isKindOfClass:[NSArray class]] && [modes containsObject:mode];
@@ -278,8 +277,11 @@ RCT_REMAP_METHOD(check,
278 277
   id<RNPermissionHandler> handler = [self handlerForPermission:permission];
279 278
 
280 279
   [handler checkWithResolver:^(RNPermissionStatus status) {
281
-    resolve([self stringForStatus:status]);
280
+    NSString *strStatus = [self stringForStatus:status];
281
+    NSLog(@"[react-native-permissions] %@ permission checked: %@", [[handler class] handlerUniqueId], strStatus);
282
+    resolve(strStatus);
282 283
   } rejecter:^(NSError *error) {
284
+    NSLog(@"[react-native-permissions] %@ permission failed: %@", [[handler class] handlerUniqueId], error.localizedDescription);
283 285
     reject([NSString stringWithFormat:@"%ld", (long)error.code], error.localizedDescription, error);
284 286
   }];
285 287
 }
@@ -291,9 +293,11 @@ RCT_REMAP_METHOD(request,
291 293
   id<RNPermissionHandler> handler = [self handlerForPermission:permission];
292 294
 
293 295
   [handler requestWithResolver:^(RNPermissionStatus status) {
294
-    [RNPermissions setRequested:handler];
295
-    resolve([self stringForStatus:status]);
296
+    NSString *strStatus = [self stringForStatus:status];
297
+    NSLog(@"[react-native-permissions] %@ permission checked: %@", [[handler class] handlerUniqueId], strStatus);
298
+    resolve(strStatus);
296 299
   } rejecter:^(NSError *error) {
300
+    NSLog(@"[react-native-permissions] %@ permission failed: %@", [[handler class] handlerUniqueId], error.localizedDescription);
297 301
     reject([NSString stringWithFormat:@"%ld", (long)error.code], error.localizedDescription, error);
298 302
   }];
299 303
 }
@@ -304,15 +308,16 @@ RCT_REMAP_METHOD(checkNotifications,
304 308
 #if __has_include("RNPermissionHandlerNotifications.h")
305 309
   RNPermissionHandlerNotifications *handler = [RNPermissionHandlerNotifications new];
306 310
 
307
-  [handler checkWithResolver:^(RNPermissionStatus status) {
308
-    [handler getSettingsWithResolver:^(NSDictionary * _Nonnull settings) {
309
-      resolve(@{ @"status": [self stringForStatus:status], @"settings": settings });
310
-    }];
311
+  [handler checkWithResolver:^(RNPermissionStatus status, NSDictionary * _Nonnull settings) {
312
+    NSString *strStatus = [self stringForStatus:status];
313
+    NSLog(@"[react-native-permissions] %@ permission checked: %@", [[handler class] handlerUniqueId], strStatus);
314
+    resolve(@{ @"status": strStatus, @"settings": settings });
311 315
   } rejecter:^(NSError * _Nonnull error) {
316
+    NSLog(@"[react-native-permissions] %@ permission failed: %@", [[handler class] handlerUniqueId], error.localizedDescription);
312 317
     reject([NSString stringWithFormat:@"%ld", (long)error.code], error.localizedDescription, error);
313 318
   }];
314 319
 #else
315
-  reject(@"notification_missing", @"Notification permission handler is missing", nil);
320
+  reject(@"notifications_pod_missing", @"Notifications permission pod is missing", nil);
316 321
 #endif
317 322
 }
318 323
 
@@ -323,15 +328,16 @@ RCT_REMAP_METHOD(requestNotifications,
323 328
 #if __has_include("RNPermissionHandlerNotifications.h")
324 329
   RNPermissionHandlerNotifications *handler = [RNPermissionHandlerNotifications new];
325 330
 
326
-  [handler requestWithResolver:^(RNPermissionStatus status) {
327
-    [handler getSettingsWithResolver:^(NSDictionary * _Nonnull settings) {
328
-      resolve(@{ @"status": [self stringForStatus:status], @"settings": settings });
329
-    }];
331
+  [handler requestWithResolver:^(RNPermissionStatus status, NSDictionary * _Nonnull settings) {
332
+    NSString *strStatus = [self stringForStatus:status];
333
+    NSLog(@"[react-native-permissions] %@ permission checked: %@", [[handler class] handlerUniqueId], strStatus);
334
+    resolve(@{ @"status": strStatus, @"settings": settings });
330 335
   } rejecter:^(NSError * _Nonnull error) {
336
+    NSLog(@"[react-native-permissions] %@ permission failed: %@", [[handler class] handlerUniqueId], error.localizedDescription);
331 337
     reject([NSString stringWithFormat:@"%ld", (long)error.code], error.localizedDescription, error);
332 338
   } options:options];
333 339
 #else
334
-  reject(@"notification_missing", @"Notification permission handler is missing", nil);
340
+  reject(@"notifications_pod_missing", @"Notifications permission pod is missing", nil);
335 341
 #endif
336 342
 }
337 343