icerockdev / moko-geo

Geolocation access for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
160 stars 16 forks source link

Android: allow changing underlying GPS service implementation #29

Open xpathexception opened 3 years ago

xpathexception commented 3 years ago

Current LocationTracker implementation is nailed to the FusedLocationProviderClient. Therefore moko-geo is unable to work properly on android devices without Google Services installed. Google Services are unavailable/not installed/not used on lots of chinese devices and some of open source firmwares.

This issue is somewhat releated to #16, because running moko-geo sample app on AVD image without Google APIs/Google Play leads to the same result with related log messages:

W/GooglePlayServicesUtil: dev.icerock.moko.samples.geo.debug requires the Google Play Store, but it is missing.
W/GoogleApiManager: The service for com.google.android.gms.internal.location.zzaz is not available [...]

There are at least couple of alternatives that can be used instead of FusedLocationProviderClient:

Besides, as a user of moko-geo I would like to have an ability to use my own bindings to location services from other custom private/device specific SDK's. So it's also would be nice to have an interface allowing to do such bindings and some APIs allowing to choose different implementations at runtime.

mykola-dev commented 2 years ago

+1 on this We use huawei services in our app. So, unfortunately, can't use this library.