Browse Source

Remove background-mode check

Mathieu Acthernoene 5 years ago
parent
commit
1ec3ad11ca

+ 0
- 7
ios/BluetoothPeripheral/RNPermissionHandlerBluetoothPeripheral.m View File

28
 #if TARGET_OS_SIMULATOR
28
 #if TARGET_OS_SIMULATOR
29
   return resolve(RNPermissionStatusNotAvailable);
29
   return resolve(RNPermissionStatusNotAvailable);
30
 #else
30
 #else
31
-  if (![RNPermissions isBackgroundModeEnabled:@"bluetooth-peripheral"]) {
32
-    return resolve(RNPermissionStatusNotAvailable);
33
-  }
34
 
31
 
35
   if (@available(iOS 13.0, *)) {
32
   if (@available(iOS 13.0, *)) {
36
     switch ([[CBManager new] authorization]) {
33
     switch ([[CBManager new] authorization]) {
60
 
57
 
61
 - (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
58
 - (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
62
                    rejecter:(void (^ _Nonnull)(NSError * _Nonnull))reject {
59
                    rejecter:(void (^ _Nonnull)(NSError * _Nonnull))reject {
63
-  if (![RNPermissions isBackgroundModeEnabled:@"bluetooth-peripheral"]) {
64
-    return resolve(RNPermissionStatusNotAvailable);
65
-  }
66
-
67
   _resolve = resolve;
60
   _resolve = resolve;
68
   _reject = reject;
61
   _reject = reject;
69
 
62
 

+ 0
- 2
ios/RNPermissions.h View File

83
 
83
 
84
 + (void)flagAsRequested:(NSString * _Nonnull)handlerId;
84
 + (void)flagAsRequested:(NSString * _Nonnull)handlerId;
85
 
85
 
86
-+ (bool)isBackgroundModeEnabled:(NSString * _Nonnull)mode;
87
-
88
 @end
86
 @end

+ 0
- 13
ios/RNPermissions.m View File

245
   }
245
   }
246
 }
246
 }
247
 
247
 
248
-+ (bool)isBackgroundModeEnabled:(NSString * _Nonnull)mode {
249
-  NSArray *modes = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIBackgroundModes"];
250
-  bool isEnabled = [modes isKindOfClass:[NSArray class]] && [modes containsObject:mode];
251
-
252
-#if RCT_DEV
253
-  if (!isEnabled) {
254
-    RCTLogWarn(@"Missing \"%@\" in \"UIBackgroundModes\" forces check / request result to \"unavailable\" status", mode);
255
-  }
256
-#endif
257
-
258
-  return isEnabled;
259
-}
260
-
261
 RCT_REMAP_METHOD(openSettings,
248
 RCT_REMAP_METHOD(openSettings,
262
                  openSettingsWithResolver:(RCTPromiseResolveBlock)resolve
249
                  openSettingsWithResolver:(RCTPromiseResolveBlock)resolve
263
                  rejecter:(RCTPromiseRejectBlock)reject) {
250
                  rejecter:(RCTPromiseRejectBlock)reject) {