React-native-geolocation-service: Android now supports new getCurrentLocation API

Created on 8 Dec 2020  路  4Comments  路  Source: Agontuk/react-native-geolocation-service

@Agontuk

getCurrentLocation API now gets fresh GPS location and handles subscription. So may be you can use it in code, instead of handling subscribing for single location request.

https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderClient#public-tasklocation-getcurrentlocation-int-priority,-cancellationtoken-token

https://android-developers.googleblog.com/2020/12/improving-urban-gps-accuracy-for-your.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+blogspot%2FhsDu+%28Android+Developers+Blog%29

Most helpful comment

I'll try implementing this. I'm currently rewriting the android implementation to add support for android's default location manager api if google play service is not available. You can check here, if you're interested.

All 4 comments

Nice finding :), but users need to have at least 17.1.0 google play service version for this to work. Should we force users to update to the newer versions ? Most of the developers face play service version mismatch quite often, so that's a concern.

Google has moved away from having same google play service version, I think if the google provided getCurrentLocation works more robust, I think its worth the change.

I'll try implementing this. I'm currently rewriting the android implementation to add support for android's default location manager api if google play service is not available. You can check here, if you're interested.

I'll try implementing this. I'm currently rewriting the android implementation to add support for android's default location manager api if google play service is not available. You can check here, if you're interested.

Should help people in china and people who try to avoid using google services for privacy issues. I will try to look on weekends.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Agontuk picture Agontuk  路  5Comments

joecaraccio picture joecaraccio  路  11Comments

Chepkeitany picture Chepkeitany  路  7Comments

rodrigofbm picture rodrigofbm  路  9Comments

giovanischiar picture giovanischiar  路  5Comments