Flutter-geolocator: not working when location service is turned off

Created on 16 Aug 2019  路  13Comments  路  Source: Baseflow/flutter-geolocator

unlike other flutter plugins this one not working when location sevice is turned off.

needs more info enhancement

Most helpful comment

I have the same problem. When I switch off GPS
await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.low/high);
just never returns.

Should it not be possible to acces the device's location via locationManager.NETWORK_PROVIDER?

Also, even though the await never finishes,
geolocator.checkGeolocationPermissionStatus();
returns status granted.

All 13 comments

Doesn't it need location services to work? How would it get the location?

@Xgamefactory can you clarify what you would expect? @aronnelson is correct that this plugin needs the location services to be running to work correctly, so what do you expect to happen when the services are not running?

  1. I'm calling Position position = await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.high);

At some of the times, when the GPS was off, after I turned it on, it got the location.
Other time.. it didn't do nothing, until I opened google maps. (tested a few times) What is this "cold" condition?

  1. When the GPS is off there should be a native dialog to turn it on, and all the user has to do it to press yes (check out what happens in google maps when the gps is off) instead of the user having to slide the bar down, and turn it on by himself.

Thanks

Currently the plugin doesn't offer a good way to request the service location activation...
The class LocationPermissions is where the service permission and activation management is done... I think that instead of openAppSettings() method should be a requestServiceActivation() or something that helps the user to enable LocationService without getting into settings or QuickSettings... FusedLocation has a function to request ServiceActivation through an AlertDialog presented to the user this is how Google Maps does it, at least for Android

I have the same problem. When I switch off GPS
await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.low/high);
just never returns.

Should it not be possible to acces the device's location via locationManager.NETWORK_PROVIDER?

Also, even though the await never finishes,
geolocator.checkGeolocationPermissionStatus();
returns status granted.

Should it not be possible to acces the device's location via locationManager.NETWORK_PROVIDER?
Obvious user error: No SIM-Card => no network....

plugin should have a method to trigger location service turn off. it is possible to programmatically on native platforms, at least on android.

I got same problem , I guess the plugin at least should return GeolocationStatus disabled but , it returns GeolocationStatus granted.
should you need a better explanation let me know. sorry about it.

I got same problem , I guess the plugin at least should return GeolocationStatus disabled but , it returns GeolocationStatus granted.
should you need a better explanation let me know. sorry about it.

I got the same issue

@carlos-labrador, @Hunter3173, if you want to know if the location services are running you can use the Geolocator().isLocationServiceEnabled() method. Please also check this issue for more details #414

We need to have a look if we can make the handling of enabling the location services in a more smooth way (which is what the original issue is about). As suggested by @luis901101 on Android we could use the FusedLocation manager to request service activation.

@carlos-labrador, @Hunter3173, if you want to know if the location services are running you can use the Geolocator().isLocationServiceEnabled() method. Please also check this issue for more details #414

We need to have a look if we can make the handling of enabling the location services in a more smooth way (which is what the original issue is about). As suggested by @luis901101 on Android we could use the FusedLocation manager to request service activation.

Thanks !

@carlos-labrador, @Hunter3173, if you want to know if the location services are running you can use the Geolocator().isLocationServiceEnabled() method. Please also check this issue for more details #414

We need to have a look if we can make the handling of enabling the location services in a more smooth way (which is what the original issue is about). As suggested by @luis901101 on Android we could use the FusedLocation manager to request service activation.

Thanks for your help.

Fixed in version 6.0.0

Was this page helpful?
0 / 5 - 0 ratings