Skip to content

Commit

Permalink
fix(andorid): fix missing config issue
Browse files Browse the repository at this point in the history
  • Loading branch information
michalchudziak committed Sep 14, 2022
1 parent fe13a18 commit 100086e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class GeolocationModule extends ReactContextBaseJavaModule {

public GeolocationModule(ReactApplicationContext reactContext) {
super(reactContext);
mConfiguration = Configuration.getDefault();
GoogleApiAvailability availability = new GoogleApiAvailability();
if (availability.isGooglePlayServicesAvailable(reactContext.getApplicationContext()) == ConnectionResult.SUCCESS) {
mLocationManager = new PlayServicesLocationManager(reactContext);
Expand Down Expand Up @@ -175,6 +176,10 @@ private Configuration(String locationProvider, boolean skipPermissionRequests) {
this.skipPermissionRequests = skipPermissionRequests;
}

protected static Configuration getDefault() {
return new Configuration("auto", false);
}

protected static Configuration fromReactMap(ReadableMap map) {
String locationProvider =
map.hasKey("locationProvider") ? map.getString("locationProvider") : "auto";
Expand Down
4 changes: 3 additions & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.parallel=false

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


0 comments on commit 100086e

Please sign in to comment.