Explorar el Código

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

Yonah Forst hace 8 años
padre
commit
bb8833c1bc
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5
    1
      permissions/RNPLocation.m

+ 5
- 1
permissions/RNPLocation.m Ver fichero

@@ -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