Skip to content

Commit

Permalink
fix(android): improve reliability of fused location lib detection
Browse files Browse the repository at this point in the history
- The Ti.Geolocation APIs would never work if "play-services-base" lib was included, but "play-services-location" lib was missing.
- Now checking for classes in both libs before proceeding to use Fused Location feature.
- This can happen in Titanium 9.0.0 now that app devs can set up their own custom "build.gradle" file which specifies its own lib dependencies.
  • Loading branch information
jquick-axway authored and sgtcoolguy committed Jan 30, 2020
1 parent db56070 commit b8cc24a
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public static boolean hasPlayServices(Context context)
}
try {
Class.forName("com.google.android.gms.common.GoogleApiAvailability");
Class.forName("com.google.android.gms.location.FusedLocationProviderClient");
return PlayServices.validVersion() && PlayServices.available(context);
} catch (Exception e) {
useFusedLocation = false;
Expand Down

0 comments on commit b8cc24a

Please sign in to comment.