Browse Source

Check type (always or wheninuse) when requesting location permission. addresses #51

Yonah Forst 7 years ago
parent
commit
bb8833c1bc
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      permissions/RNPLocation.m

+ 5
- 1
permissions/RNPLocation.m View File

@@ -50,7 +50,11 @@
50 50
             [self.locationManager requestWhenInUseAuthorization];
51 51
         }
52 52
     } else {
53
-        completionHandler(status);
53
+        if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedWhenInUse && [type isEqualToString:@"always"]) {
54
+            completionHandler(RNPStatusDenied);
55
+        } else {
56
+            completionHandler(status);
57
+        }
54 58
     }
55 59
 }
56 60