-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android - Turn on Location Service popup not coming #108
Comments
You have both On another note, remove all android related setup described in README file. It is not needed in RN60 as it'll integrate the module automatically when installed. |
@Agontuk I understand these things.
I have added a. After installing
As you said it I just created a new empty project and integrated this library, but unfortunately the result is same. I am not getting popup.
I have mentioned the ACCESS_FINE_LOCATION in Manifest file and enabled the permission for app from settings. |
What Android version are you using on your device when this happens? |
@oakis I have tested on two devices with Android 8.0 and Android 7.0 |
@Android773 Can you try with Android 9? Might be a similar issue a bunch of others have been experiencing. |
@oakis I tried with Android 9 as well, but it is not asking to turn Location Service on when Location is off. |
have you solved this issue? |
Getting the same issue in Android version 9, package version 3.0.0 and RN version 0.60.4. No solutions so far. |
@prasan2421 Which React Native version you are using? |
Same for us with GPS Sensor deactivated on Android:
Tested on an Android 9 Device:
on iOS it works (when deactivating the locationService in device settings it reports back as no permission for app though) |
v 0.60.4 |
Remove @react-native-community/geolocation": "^1.4.2", plugin and try |
as stated before, that is a dependency for the plugin to work with iOS. Is it possible this is an issue with the "@react-native-community/geolocation" plugin instead which is causing this one to show this behaviour? |
i havent kept this plugin yet i have the issue, but im using @react-native-community/netinfo. |
Guys, can anyone give me a sample project for this issue ? I am running an example with RN60 in my mobile and location popup is working fine for me. Also please provide any steps necessary to reproduce this. |
https://github.com/prasan2421/location-test-project |
I have the same issue. |
It seems like PR #68 introduced an additional check to determine whether location providers are enabled or not. If no providers are available, it'll immediately return error response instead of showing popup. This check is needed because it enables us to request location even when location setting is set to We may need to find an alternate solution. What are your thoughts guys ? |
so will this issue be fixed? i was also wondering how few others above managed to make this working. |
Guys, let me know if this flow makes sense. Looping in @cladjules since he implemented the
|
@Agontuk Sounds good to me. |
I have the same problem (of course in Android)
Did anyone get any solution? Thanks. |
Fixed in |
Everything's fine, thanks to @Agontuk |
@Agontuk Great! It is working fine after updating to 3.1.0. Thanks a lot. |
@Agontuk, @cladjules : this works as intended, in my case I have the options {
enableHighAccuracy: true,
timeout: 15000,
maximumAge: 1000 * 60 * 3,
forceRequestLocation: true,
showLocationDialog: true,
} and I see the dialogue about improving location by activating Location Services, I can answer 'No, thanks' and I still get a location! Thanks for the work btw. This is great because I do have a few users for whom activating the Google Location Services isn't an option but many others for whom it's fine. However, for users without these Google Location Services, it seems the dialogue will show every single time my app needs to grab the location. Which might quickly become annoying for them since the main interaction in my app makes the app ask for the current location. Is that the way you guys deliver this or did I miss some way to be more user-friendly? By only showing that dialogue once and remembering to force without dialogue afterwards for instance? |
Hi! Using
the location dialog doesn't appear if the GPS is off and it results in error callback {"code": 2, "message": "No location provider available."}. Thank you! |
@fabripeco Check for permissions first I guess https://facebook.github.io/react-native/docs/permissionsandroid |
No, I get the necessary permissions before calling watchPosition. Actually when I call getCurrentPosition, the location dialog is shown and GPS is turned on when I click Ok. The problem raises only with watchPosition and GPS turned off. Something wrong with my code? Ideas? |
I get this issue using Android Studio Emulator of a Pixel 2 API 30 using Android 10.0+ and having chosen in my location settings to "Ask every time". It always triggers the error callback. Is this specific to using an emulator? |
I'm also having this issue on Android 10.0 API 29 on a Nexus S emulator. And even trying to set force to true is not making the pop up to show.
|
Unable to reproduce this, using the same emulator. Can you provide reproducible steps ? Also I don't think location service popup will be shown in android 10+ devices, because location mode is no longer available in those api versions. |
|
@Deepak13312 also have the same problem, haven't found a solution to it. |
This may be of little help, first make sure no library location other than react-native-geolocation-service. then if there is no use react hook. you might try this method below.
|
Can anyone help me on this ? const result = Functions.getInstance().requestLocationPermission();
|
Hi,
My setup is
And code is:
Scenario:
When the Location in top drawer menu is ON then I am getting location.
But when Location is off, it is not showing the following popup to ask user to enable the location service:
Instead, it directly goes to (error) and says, "error.code = 2, No location provider available."
I think in earlier versions of library this used to work. But facing this problem in 3.0.0.
3. In iOS it is working fine. It is showing popup to ask for Permission for Location.
Any help on this would be appreciated.
P.S. @Agontuk Thanks for this library. We really appreciate your efforts.
The text was updated successfully, but these errors were encountered: