|
@@ -281,5 +281,24 @@ RCT_REMAP_METHOD(notificationPermissionStatus, notificationPermission:(RCTPromis
|
281
|
281
|
}
|
282
|
282
|
}
|
283
|
283
|
|
|
284
|
+RCT_REMAP_METHOD(backgroundRefreshStatus, backgroundRefresh:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
285
|
+{
|
|
286
|
+ int status = [[UIApplication sharedApplication] backgroundRefreshStatus];
|
|
287
|
+
|
|
288
|
+ switch (status) {
|
|
289
|
+ case UIBackgroundRefreshStatusAvailable:
|
|
290
|
+ return resolve(@(RNPermissionsStatusAuthorized));
|
|
291
|
+
|
|
292
|
+ case UIBackgroundRefreshStatusDenied:
|
|
293
|
+ return resolve(@(RNPermissionsStatusDenied));
|
|
294
|
+
|
|
295
|
+ case UIBackgroundRefreshStatusRestricted:
|
|
296
|
+ return resolve(@(RNPermissionsStatusRestricted));
|
|
297
|
+
|
|
298
|
+ default:
|
|
299
|
+ return resolve(@(RNPermissionsStatusUndetermined));
|
|
300
|
+ }
|
|
301
|
+
|
|
302
|
+}
|
284
|
303
|
|
285
|
304
|
@end
|