Skip to content

Commit f14093a

Browse files
committed
Add warning about missing UIBackgroundModes
1 parent 0a411b2 commit f14093a

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

example/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ DEPENDENCIES:
301301
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
302302

303303
SPEC REPOS:
304-
https://github.com/cocoapods/specs.git:
304+
https://github.com/CocoaPods/Specs.git:
305305
- boost-for-react-native
306306

307307
EXTERNAL SOURCES:
@@ -435,6 +435,6 @@ SPEC CHECKSUMS:
435435
RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
436436
Yoga: 14927e37bd25376d216b150ab2a561773d57911f
437437

438-
PODFILE CHECKSUM: ec8fe71d38ad340f719e72f6450303b56c99944c
438+
PODFILE CHECKSUM: 70f55b4fbde93d4bb26d3fe0576d9f0813e81c72
439439

440-
COCOAPODS: 1.7.5
440+
COCOAPODS: 1.8.1

example/ios/RNPermissionsExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
13B07F8C1A680F5B00A75B9A /* Frameworks */,
110110
13B07F8E1A680F5B00A75B9A /* Resources */,
111111
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
112-
7BFDA05E75F4BA8ABC64EEC3 /* [CP] Copy Pods Resources */,
112+
D15EC6C7ABF193B661727531 /* [CP] Copy Pods Resources */,
113113
);
114114
buildRules = (
115115
);
@@ -202,7 +202,7 @@
202202
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";
203203
showEnvVarsInLog = 0;
204204
};
205-
7BFDA05E75F4BA8ABC64EEC3 /* [CP] Copy Pods Resources */ = {
205+
D15EC6C7ABF193B661727531 /* [CP] Copy Pods Resources */ = {
206206
isa = PBXShellScriptBuildPhase;
207207
buildActionMask = 2147483647;
208208
files = (

ios/RNPermissions.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,15 @@ + (void)flagAsRequested:(NSString * _Nonnull)handlerId {
247247

248248
+ (bool)isBackgroundModeEnabled:(NSString * _Nonnull)mode {
249249
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;
251259
}
252260

253261
RCT_REMAP_METHOD(openSettings,

0 commit comments

Comments
 (0)