Most of China does not have google play service
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 ...
A provider using FusedLocationProviderClient (which user in China won't be able to user)
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.
Most helpful comment
The implementation is done, you can try using the
android-rewritebranch to test it out.