Skip to content

Commit 100086e

Browse files
fix(andorid): fix missing config issue
1 parent fe13a18 commit 100086e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

android/src/main/java/com/reactnativecommunity/geolocation/GeolocationModule.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class GeolocationModule extends ReactContextBaseJavaModule {
3232

3333
public GeolocationModule(ReactApplicationContext reactContext) {
3434
super(reactContext);
35+
mConfiguration = Configuration.getDefault();
3536
GoogleApiAvailability availability = new GoogleApiAvailability();
3637
if (availability.isGooglePlayServicesAvailable(reactContext.getApplicationContext()) == ConnectionResult.SUCCESS) {
3738
mLocationManager = new PlayServicesLocationManager(reactContext);
@@ -175,6 +176,10 @@ private Configuration(String locationProvider, boolean skipPermissionRequests) {
175176
this.skipPermissionRequests = skipPermissionRequests;
176177
}
177178

179+
protected static Configuration getDefault() {
180+
return new Configuration("auto", false);
181+
}
182+
178183
protected static Configuration fromReactMap(ReadableMap map) {
179184
String locationProvider =
180185
map.hasKey("locationProvider") ? map.getString("locationProvider") : "auto";

example/android/gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18-
# org.gradle.parallel=true
18+
org.gradle.parallel=false
1919

2020
# AndroidX package structure to make it clearer which packages are bundled with the
2121
# Android operating system, and which are packaged with your app's APK
@@ -38,3 +38,5 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3838
# to write custom TurboModules/Fabric components OR use libraries that
3939
# are providing them.
4040
newArchEnabled=true
41+
42+

0 commit comments

Comments
 (0)