From 03dfb92c6442823783e554ee7cced34fef6090f4 Mon Sep 17 00:00:00 2001 From: BASTIEN Valentin Date: Tue, 15 Jan 2019 08:30:35 +0100 Subject: [PATCH 01/10] add homepage (now mandatory to use pods) --- ios/ReactNativeAndroidLocationSwitch.podspec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ios/ReactNativeAndroidLocationSwitch.podspec b/ios/ReactNativeAndroidLocationSwitch.podspec index d4c08cb..014ef83 100644 --- a/ios/ReactNativeAndroidLocationSwitch.podspec +++ b/ios/ReactNativeAndroidLocationSwitch.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |s| s.description = <<-DESC ReactNativeAndroidLocationSwitch DESC - s.homepage = "" + s.homepage = "https://github.com/philiWeitz/react-native-location-switch" s.license = "Apache-2.0" # s.license = { :type => "Apache-2.0", :file => "../LICENSE" } s.author = { "author" => "author@domain.cn" } @@ -20,5 +20,3 @@ Pod::Spec.new do |s| #s.dependency "others" end - - \ No newline at end of file From 891919f852dcacc9946f277350042f839b6ed146 Mon Sep 17 00:00:00 2001 From: BASTIEN Valentin Date: Tue, 15 Jan 2019 09:06:20 +0100 Subject: [PATCH 02/10] set correct path for .m and .h into podspec --- ios/ReactNativeAndroidLocationSwitch.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/ReactNativeAndroidLocationSwitch.podspec b/ios/ReactNativeAndroidLocationSwitch.podspec index 014ef83..21e4012 100644 --- a/ios/ReactNativeAndroidLocationSwitch.podspec +++ b/ios/ReactNativeAndroidLocationSwitch.podspec @@ -12,7 +12,7 @@ Pod::Spec.new do |s| s.author = { "author" => "author@domain.cn" } s.platform = :ios, "7.0" s.source = { :git => "https://github.com/philiWeitz/react-native-android-location-switch.git", :tag => "master" } - s.source_files = "ReactNativeAndroidLocationSwitch/**/*.{h,m}" + s.source_files = "*.{h,m}" s.requires_arc = true From 527dc344343421bf71385754d87800bdf1083050 Mon Sep 17 00:00:00 2001 From: BASTIEN Valentin Date: Tue, 15 Jan 2019 09:11:42 +0100 Subject: [PATCH 03/10] update min version of iOS to 8 (due to UIApplicationOpenSettingsURLString) --- ios/ReactNativeAndroidLocationSwitch.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/ReactNativeAndroidLocationSwitch.podspec b/ios/ReactNativeAndroidLocationSwitch.podspec index 21e4012..cf330f4 100644 --- a/ios/ReactNativeAndroidLocationSwitch.podspec +++ b/ios/ReactNativeAndroidLocationSwitch.podspec @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.license = "Apache-2.0" # s.license = { :type => "Apache-2.0", :file => "../LICENSE" } s.author = { "author" => "author@domain.cn" } - s.platform = :ios, "7.0" + s.platform = :ios, "8.0" s.source = { :git => "https://github.com/philiWeitz/react-native-android-location-switch.git", :tag => "master" } s.source_files = "*.{h,m}" s.requires_arc = true From a3d5fdf5897afd8ef4e97284a4afab94958666e7 Mon Sep 17 00:00:00 2001 From: BASTIEN Valentin Date: Tue, 15 Jan 2019 09:12:49 +0100 Subject: [PATCH 04/10] update README to highlight npm install --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ed090ea..db62317 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A react Native module to enable location based services on Android and IOS. ## Installation Android -1. npm install react-native-location-switch +1. ```npm install react-native-location-switch``` 2. add the following 2 lines to your /android/settings.gradle file ``` @@ -59,7 +59,7 @@ A react Native module to enable location based services on Android and IOS. ## Installation IOS -1. Open the project in xCode, left click on the Libraries folder -> Add files to ... and select +1. Open the project in xCode, left click on the Libraries folder -> Add files to ... and select ``` ./node_modules/react-native-location-switch/ios/RNReactNativeLocationSwitch.xcodeproj ``` From 1b91b293c58010464ad465305e52ec5f7c21f444 Mon Sep 17 00:00:00 2001 From: BASTIEN Valentin Date: Tue, 15 Jan 2019 09:14:37 +0100 Subject: [PATCH 05/10] do not try to use "App-Prefs:root=Privacy&path=LOCATION" It seems it cause App rejection from the app store to use these links --- ios/RNReactNativeLocationSwitch.m | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ios/RNReactNativeLocationSwitch.m b/ios/RNReactNativeLocationSwitch.m index 9f5122e..eacf632 100644 --- a/ios/RNReactNativeLocationSwitch.m +++ b/ios/RNReactNativeLocationSwitch.m @@ -20,15 +20,13 @@ - (dispatch_queue_t)methodQueue CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; if (![CLLocationManager locationServicesEnabled]) { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"App-Prefs:root=Privacy&path=LOCATION"] options:@{} - completionHandler:^(BOOL success) {}]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; } else if (status == kCLAuthorizationStatusDenied) { NSLog(@"Location Services Disabled"); - + // show location settings - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} - completionHandler:^(BOOL success) {}]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; } else { NSLog(@"Location Services Enabled"); @@ -42,7 +40,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 be62883577acd701f69f72291bff2e29c8015dd7 Mon Sep 17 00:00:00 2001 From: BASTIEN Valentin Date: Tue, 15 Jan 2019 09:16:29 +0100 Subject: [PATCH 06/10] add comment to explain "App-Prefs:root=Privacy&path=LOCATION" removal --- ios/RNReactNativeLocationSwitch.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ios/RNReactNativeLocationSwitch.m b/ios/RNReactNativeLocationSwitch.m index eacf632..f08f6de 100644 --- a/ios/RNReactNativeLocationSwitch.m +++ b/ios/RNReactNativeLocationSwitch.m @@ -20,6 +20,8 @@ - (dispatch_queue_t)methodQueue CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; if (![CLLocationManager locationServicesEnabled]) { + // redirect to the app settings page not the previously set "App-Prefs:root=Privacy&path=LOCATION" + // thus to avoid app rejection from the app store [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; } else if (status == kCLAuthorizationStatusDenied) { From 3f2b4bf0519d95637a21e7b63aca5ad58f457f1d Mon Sep 17 00:00:00 2001 From: BASTIEN Valentin Date: Tue, 15 Jan 2019 09:19:20 +0100 Subject: [PATCH 07/10] update readme to add pod instructions --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index db62317..d3c1cbd 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,15 @@ A react Native module to enable location based services on Android and IOS. ## Installation IOS +Using Pods : + +1. add the following into your podfile : + ``` + pod 'ReactNativeAndroidLocationSwitch', :path => '../node_modules/react-native-location-switch/ios' + ``` + +Using xcode : + 1. Open the project in xCode, left click on the Libraries folder -> Add files to ... and select ``` ./node_modules/react-native-location-switch/ios/RNReactNativeLocationSwitch.xcodeproj @@ -67,6 +76,7 @@ A react Native module to enable location based services on Android and IOS. 2. Open the project -> Build Phases -> Link Binary With Libraries and select libRNReactNativeLocationSwitch.a + ## React Native Interface ```javascript From 6516d7ec7fc9f56e7530dd07afaa7c68ded4603f Mon Sep 17 00:00:00 2001 From: BASTIEN Valentin Date: Tue, 15 Jan 2019 09:21:16 +0100 Subject: [PATCH 08/10] update indentation --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d3c1cbd..60a5971 100644 --- a/README.md +++ b/README.md @@ -62,9 +62,9 @@ A react Native module to enable location based services on Android and IOS. Using Pods : 1. add the following into your podfile : - ``` - pod 'ReactNativeAndroidLocationSwitch', :path => '../node_modules/react-native-location-switch/ios' - ``` + ``` + pod 'ReactNativeAndroidLocationSwitch', :path => '../node_modules/react-native-location-switch/ios' + ``` Using xcode : From 81c7e01fa83faef4e20ef04a18432f58cd263a62 Mon Sep 17 00:00:00 2001 From: BASTIEN Valentin Date: Wed, 2 Dec 2020 11:27:46 +0100 Subject: [PATCH 09/10] Remove warning of implementation instead of compile [migration-android-x] --- android/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index b2aaa7b..ab7f11f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -40,6 +40,6 @@ repositories { dependencies { - compile 'com.facebook.react:react-native:+' - compile 'com.google.android.gms:play-services-location:11.0.0' + implementation 'com.facebook.react:react-native:+' + implementation 'com.google.android.gms:play-services-location:11.0.0' } From 13377118b29e6dc9c2180dd4ed840ee37fbd71a9 Mon Sep 17 00:00:00 2001 From: Steven Toussaint <> Date: Fri, 8 Dec 2023 14:29:17 +0100 Subject: [PATCH 10/10] Upgrade to android sdk version 30 --- android/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index ab7f11f..3368ac4 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -20,12 +20,12 @@ buildscript { apply plugin: 'com.android.library' android { - compileSdkVersion 26 - buildToolsVersion "26.0.1" + compileSdkVersion 30 + buildToolsVersion "30.0.0" defaultConfig { minSdkVersion 16 - targetSdkVersion 26 + targetSdkVersion 30 versionCode 1 versionName computeVersionName() }