소스 검색

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

Yonah Forst 7 년 전
부모
커밋
bb8833c1bc
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5
    1
      permissions/RNPLocation.m

+ 5
- 1
permissions/RNPLocation.m 파일 보기

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