瀏覽代碼

Remove background-mode check

Mathieu Acthernoene 5 年之前
父節點
當前提交
1ec3ad11ca
共有 3 個文件被更改,包括 0 次插入22 次删除
  1. 0
    7
      ios/BluetoothPeripheral/RNPermissionHandlerBluetoothPeripheral.m
  2. 0
    2
      ios/RNPermissions.h
  3. 0
    13
      ios/RNPermissions.m

+ 0
- 7
ios/BluetoothPeripheral/RNPermissionHandlerBluetoothPeripheral.m 查看文件

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

+ 0
- 2
ios/RNPermissions.h 查看文件

@@ -83,6 +83,4 @@ typedef enum {
83 83
 
84 84
 + (void)flagAsRequested:(NSString * _Nonnull)handlerId;
85 85
 
86
-+ (bool)isBackgroundModeEnabled:(NSString * _Nonnull)mode;
87
-
88 86
 @end

+ 0
- 13
ios/RNPermissions.m 查看文件

@@ -245,19 +245,6 @@ RCT_EXPORT_MODULE();
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 248
 RCT_REMAP_METHOD(openSettings,
262 249
                  openSettingsWithResolver:(RCTPromiseResolveBlock)resolve
263 250
                  rejecter:(RCTPromiseRejectBlock)reject) {