React-native-geolocation-service: Is it not possible to use this library for mobile phones without google play service?

Created on 5 Sep 2020  路  7Comments  路  Source: Agontuk/react-native-geolocation-service

Most of China does not have google play service

Most helpful comment

The implementation is done, you can try using the android-rewrite branch to test it out.

All 7 comments

Unfortunately no, this library currently depends on the google-play-service-location package.

Would it be possible to fall back to using AOSP location if Play Services aren't installed?

Would it be possible to fall back to using AOSP location if Play Services aren't installed?

It's possible, but that's not implemented yet. It's kind of a big change, so it may take some time.

This currently a work in progress, you can track the progress here

Hi @Agontuk, can I assume the AOSP location is not depending on Play Services as @kasbah mentioned? Pretty new to Android, kindly correct if I've understood wrongly.

Hence your work here is actually creating ...

  1. A provider using FusedLocationProviderClient (which user in China won't be able to user)

  2. Another provider using android.location.LocationManager which is a fallback solution to user in China? - which is the AOSP?

Have I understand that correctly?

@TommyLeong , yes that's correct. This implementation will check if google play service is available on device, then use the correct provider based on that. Here's the relevant code
https://github.com/Agontuk/react-native-geolocation-service/blob/android-rewrite/android/src/main/java/com/agontuk/RNFusedLocation/RNFusedLocationModule.java#L105-L113

The implementation is done, you can try using the android-rewrite branch to test it out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joecaraccio picture joecaraccio  路  11Comments

archana-iron picture archana-iron  路  5Comments

lingxiao-Zhu picture lingxiao-Zhu  路  3Comments

giovanischiar picture giovanischiar  路  5Comments

joaom182 picture joaom182  路  4Comments