Skip to content

Commit 2d496bb

Browse files
committed
Remove [CLLocationManager locationServicesEnabled] checks
1 parent 1eed829 commit 2d496bb

File tree

6 files changed

+5
-31
lines changed

6 files changed

+5
-31
lines changed

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ PODS:
487487
- React-jsi (= 0.72.5)
488488
- React-logger (= 0.72.5)
489489
- React-perflogger (= 0.72.5)
490-
- RNPermissions (3.9.3):
490+
- RNPermissions (3.10.0):
491491
- React-Core
492492
- RNVectorIcons (10.0.0):
493493
- React-Core
@@ -720,7 +720,7 @@ SPEC CHECKSUMS:
720720
React-runtimescheduler: cc32add98c45c5df18436a6a52a7e1f6edec102c
721721
React-utils: 7a9918a1ffdd39aba67835d42386f592ea3f8e76
722722
ReactCommon: 91ece8350ebb3dd2be9cef662abd78b6948233c0
723-
RNPermissions: 526f69d111311db5656f5e203a96acae1403ecbe
723+
RNPermissions: 841114b546bd9d07254d76b8ed9c1a365fe95195
724724
RNVectorIcons: 8b5bb0fa61d54cd2020af4f24a51841ce365c7e9
725725
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
726726
Yoga: 86fed2e4d425ee4c6eab3813ba1791101ee153c6

example/ios/RNPermissionsExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,7 @@
402402
);
403403
OTHER_LDFLAGS = (
404404
"$(inherited)",
405-
"-Wl",
406-
"-ld_classic",
407-
" ",
405+
"-Wl -ld_classic ",
408406
);
409407
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
410408
SDKROOT = iphoneos;
@@ -477,9 +475,7 @@
477475
);
478476
OTHER_LDFLAGS = (
479477
"$(inherited)",
480-
"-Wl",
481-
"-ld_classic",
482-
" ",
478+
"-Wl -ld_classic ",
483479
);
484480
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
485481
SDKROOT = iphoneos;

ios/LocationAccuracy/RNPermissionHandlerLocationAccuracy.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ + (NSString * _Nonnull)handlerUniqueId {
2323
- (void)checkWithResolver:(RCTPromiseResolveBlock _Nonnull)resolve
2424
rejecter:(RCTPromiseRejectBlock _Nonnull)reject {
2525
if (@available(iOS 14, *)) {
26-
if (![CLLocationManager locationServicesEnabled]) {
27-
return reject(@"cannot_check_location_accuracy", @"Location services are disabled", nil);
28-
}
29-
3026
switch ([CLLocationManager authorizationStatus]) {
3127
case kCLAuthorizationStatusNotDetermined:
3228
return reject(@"cannot_check_location_accuracy", @"Location permission hasn't been requested first", nil);
@@ -55,10 +51,6 @@ - (void)requestWithPurposeKey:(NSString * _Nonnull)purposeKey
5551
resolver:(RCTPromiseResolveBlock _Nonnull)resolve
5652
rejecter:(RCTPromiseRejectBlock _Nonnull)reject {
5753
if (@available(iOS 14, *)) {
58-
if (![CLLocationManager locationServicesEnabled]) {
59-
return reject(@"cannot_request_location_accuracy", @"Location services are disabled", nil);
60-
}
61-
6254
switch ([CLLocationManager authorizationStatus]) {
6355
case kCLAuthorizationStatusNotDetermined:
6456
return reject(@"cannot_request_location_accuracy", @"Location permission hasn't been requested first", nil);

ios/LocationAlways/RNPermissionHandlerLocationAlways.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ + (NSString * _Nonnull)handlerUniqueId {
2323

2424
- (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
2525
rejecter:(void (__unused ^ _Nonnull)(NSError * _Nonnull))reject {
26-
if (![CLLocationManager locationServicesEnabled]) {
27-
return resolve(RNPermissionStatusNotAvailable);
28-
}
29-
3026
switch ([CLLocationManager authorizationStatus]) {
3127
case kCLAuthorizationStatusNotDetermined:
3228
return resolve(RNPermissionStatusNotDetermined);
@@ -42,9 +38,6 @@ - (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
4238

4339
- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
4440
rejecter:(void (^ _Nonnull)(NSError * _Nonnull))reject {
45-
if (![CLLocationManager locationServicesEnabled]) {
46-
return resolve(RNPermissionStatusNotAvailable);
47-
}
4841
if ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusNotDetermined) {
4942
return [self checkWithResolver:resolve rejecter:reject];
5043
}

ios/LocationWhenInUse/RNPermissionHandlerLocationWhenInUse.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ + (NSString * _Nonnull)handlerUniqueId {
2222

2323
- (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
2424
rejecter:(void (__unused ^ _Nonnull)(NSError * _Nonnull))reject {
25-
if (![CLLocationManager locationServicesEnabled]) {
26-
return resolve(RNPermissionStatusNotAvailable);
27-
}
28-
2925
switch ([CLLocationManager authorizationStatus]) {
3026
case kCLAuthorizationStatusNotDetermined:
3127
return resolve(RNPermissionStatusNotDetermined);
@@ -41,9 +37,6 @@ - (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
4137

4238
- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
4339
rejecter:(void (^ _Nonnull)(NSError * _Nonnull))reject {
44-
if (![CLLocationManager locationServicesEnabled]) {
45-
return resolve(RNPermissionStatusNotAvailable);
46-
}
4740
if ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusNotDetermined) {
4841
return [self checkWithResolver:resolve rejecter:reject];
4942
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-permissions",
3-
"version": "3.9.3",
3+
"version": "3.10.0",
44
"license": "MIT",
55
"description": "An unified permissions API for React Native on iOS, Android and Windows",
66
"author": "Mathieu Acthernoene <zoontek@gmail.com>",

0 commit comments

Comments
 (0)