From 1070518dc76c127ca3015db7f4674d270c34ebf7 Mon Sep 17 00:00:00 2001 From: Bogdan Pop Date: Wed, 6 Feb 2019 10:12:33 +0200 Subject: [PATCH 1/2] Apple rejection guideline 2.5.1 (#1) Guideline 2.5.1 - Performance - Software Requirements Your app uses or references the following non-public APIs Removed App-Prefs:root=Privacy&path=LOCATION and switched to UIApplicationOpenSettingsURLString so that the app doesn't get rejected during Apple Store Review. --- ios/RNReactNativeLocationSwitch.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ios/RNReactNativeLocationSwitch.m b/ios/RNReactNativeLocationSwitch.m index 9f5122e..f8f0a8e 100644 --- a/ios/RNReactNativeLocationSwitch.m +++ b/ios/RNReactNativeLocationSwitch.m @@ -20,12 +20,19 @@ - (dispatch_queue_t)methodQueue CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; if (![CLLocationManager locationServicesEnabled]) { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"App-Prefs:root=Privacy&path=LOCATION"] options:@{} + /* + using "App-Prefs:root=Privacy&path=LOCATION" results in app store rejection under + Guideline 2.5.1 - Performance - Software Requirements + The use of non-public APIs is not permitted on the App Store + because it can lead to a poor user experience should these APIs change. + */ + // show location settings + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:^(BOOL success) {}]; } else if (status == kCLAuthorizationStatusDenied) { NSLog(@"Location Services Disabled"); - + // show location settings [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:^(BOOL success) {}]; @@ -42,7 +49,7 @@ - (dispatch_queue_t)methodQueue onLocationDisable:(RCTResponseSenderBlock)errorCallback) { CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; - + if (![CLLocationManager locationServicesEnabled] || status == kCLAuthorizationStatusDenied) { NSLog(@"Location Services Disabled"); errorCallback(@[[NSNull null]]); From e6ae8f7c3e3bb7b56c27636ced8c84706596f979 Mon Sep 17 00:00:00 2001 From: webraptor Date: Wed, 6 Feb 2019 10:15:16 +0200 Subject: [PATCH 2/2] bump package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3fb20b8..43330b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-location-switch", - "version": "0.1.0", + "version": "0.1.1", "author": "Philipp Weitz", "private": false, "license": "Apache-2.0",