Browse Source

Add warning about missing UIBackgroundModes

Mathieu Acthernoene 5 years ago
parent
commit
f14093aa32

+ 3
- 3
example/ios/Podfile.lock View File

@@ -301,7 +301,7 @@ DEPENDENCIES:
301 301
   - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
302 302
 
303 303
 SPEC REPOS:
304
-  https://github.com/cocoapods/specs.git:
304
+  https://github.com/CocoaPods/Specs.git:
305 305
     - boost-for-react-native
306 306
 
307 307
 EXTERNAL SOURCES:
@@ -435,6 +435,6 @@ SPEC CHECKSUMS:
435 435
   RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
436 436
   Yoga: 14927e37bd25376d216b150ab2a561773d57911f
437 437
 
438
-PODFILE CHECKSUM: ec8fe71d38ad340f719e72f6450303b56c99944c
438
+PODFILE CHECKSUM: 70f55b4fbde93d4bb26d3fe0576d9f0813e81c72
439 439
 
440
-COCOAPODS: 1.7.5
440
+COCOAPODS: 1.8.1

+ 2
- 2
example/ios/RNPermissionsExample.xcodeproj/project.pbxproj View File

@@ -109,7 +109,7 @@
109 109
 				13B07F8C1A680F5B00A75B9A /* Frameworks */,
110 110
 				13B07F8E1A680F5B00A75B9A /* Resources */,
111 111
 				00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
112
-				7BFDA05E75F4BA8ABC64EEC3 /* [CP] Copy Pods Resources */,
112
+				D15EC6C7ABF193B661727531 /* [CP] Copy Pods Resources */,
113 113
 			);
114 114
 			buildRules = (
115 115
 			);
@@ -202,7 +202,7 @@
202 202
 			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
203 203
 			showEnvVarsInLog = 0;
204 204
 		};
205
-		7BFDA05E75F4BA8ABC64EEC3 /* [CP] Copy Pods Resources */ = {
205
+		D15EC6C7ABF193B661727531 /* [CP] Copy Pods Resources */ = {
206 206
 			isa = PBXShellScriptBuildPhase;
207 207
 			buildActionMask = 2147483647;
208 208
 			files = (

+ 9
- 1
ios/RNPermissions.m View File

@@ -247,7 +247,15 @@ RCT_EXPORT_MODULE();
247 247
 
248 248
 + (bool)isBackgroundModeEnabled:(NSString * _Nonnull)mode {
249 249
   NSArray *modes = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIBackgroundModes"];
250
-  return [modes isKindOfClass:[NSArray class]] && [modes containsObject:mode];
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;
251 259
 }
252 260
 
253 261
 RCT_REMAP_METHOD(openSettings,