File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ @implementation RNPLocation
1919
2020+ (NSString *)getStatusForType : (NSString *)type
2121{
22+ if (![CLLocationManager locationServicesEnabled ]) {
23+ return RNPStatusRestricted;
24+ }
25+
2226 int status = [CLLocationManager authorizationStatus ];
2327 switch (status) {
2428 case kCLAuthorizationStatusAuthorizedAlways :
@@ -36,6 +40,10 @@ + (NSString *)getStatusForType:(NSString *)type
3640
3741- (void )request : (NSString *)type completionHandler : (void (^)(NSString *))completionHandler
3842{
43+ if (![CLLocationManager locationServicesEnabled ]) {
44+ return completionHandler (RNPStatusRestricted);
45+ }
46+
3947 NSString *status = [RNPLocation getStatusForType: nil ];
4048 if (status == RNPStatusUndetermined) {
4149 self.completionHandler = completionHandler;
You can’t perform that action at this time.
0 commit comments