Agontuk / react-native-geolocation-service

React native geolocation service for iOS and android
https://www.npmjs.com/package/react-native-geolocation-service
MIT License
1.61k stars 291 forks source link

What ways to use the library if a phone without google services? #273

Closed alexfov closed 3 years ago

alexfov commented 3 years ago

Hello and ty for a such useful library. Could you say what should I do if user doesn't have google services? Is there any other way to get geolocation?

yogesch commented 3 years ago

The older https://github.com/react-native-geolocation/react-native-geolocation library will be a good fit. It used to be the standard until things moved to services.

But as it says on their homepage, even they are considering migrating to services (but judging by the zero activity for the last 2 years, they might not).

yogesch commented 3 years ago

Alternatively, I think https://github.com/timfpark/react-native-location also has an option to change the provider to "standard" (without services). I have not tried using it that way, but it should work.

By default it will choose the playServices location provider if it detects that the dependencies are installed, otherwise, it will use the standard Android version which does not require Google Play Services to be installed.

Edit - I just tried this library with "standard" and it works.

alexfov commented 3 years ago

Alternatively, I think https://github.com/timfpark/react-native-location also has an option to change the provider to "standard" (without services). I have not tried using it that way, but it should work.

By default it will choose the playServices location provider if it detects that the dependencies are installed, otherwise, it will use the standard Android version which does not require Google Play Services to be installed.

Edit - I just tried this library with "standard" and it works.

So we have to use another library.. Thank you a lot @yogesch

yogesch commented 3 years ago

So we have to use another library.. Thank you a lot @yogesch

This library might also soon have the option to use the standard location manager instead of the services geolocation. Check the maintainer's comments in this issue.

https://github.com/Agontuk/react-native-geolocation-service/issues/227

Agontuk commented 3 years ago

If phone does not have google play service, it'll automatically switch to standard android implementation. You've to use 5.3.0-beta.1 for this to work.

yogesch commented 3 years ago

If phone does not have google play service, it'll automatically switch to standard android implementation. You've to use 5.3.0-beta.1 for this to work.

Is there also a way to manually switch to the standard Android implementation? In case the play service doesn't work as expected?

Agontuk commented 3 years ago

Not right now, but it can be done by exposing a new option in js side.

yogesch commented 3 years ago

Yeah it should be relatively straightforward and very helpful also.

On Wed, 26 May 2021, 17:58 Iftekhar Rifat, @.***> wrote:

Not right now, but it can be done by exposing a new option in js side.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Agontuk/react-native-geolocation-service/issues/273#issuecomment-848727200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AENQRYNPGLRTOJQUE4OKYTDTPTSOPANCNFSM45NA2ZXQ .