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
Location doesn't work on IOS emulator #453
Comments
@LarryJing I cannot reproduce this problem, did you actually simulate location updates? On the iOS simulator you need to actively set a location using the following menu option: "Features" -> "Location": |
the error does not occur when the module version change to |
I am also running into this. I do not want to request location in the background, only foreground. I would hope that means I shouldn’t need to enable a background mode. |
This is indeed an error that went live by mistake. I will correct it later today/ tomorrow. Until then either enable location updates in the background or stick with 5.3.1 |
I have just released a hotfix (version 5.3.2+1) which should fix this issue. The option to enable Backgroup location updates is now configurable using the Thanks everybody for helping debug this. Please let me know if it works correctly again. |
Confirmed fix, closing the issue. |
Hi there, I'm new here using geolocation services with flutter and I've found this project, looks good, but I have a problem when I try to get the current location, the application stops and it gets closed after pressing a simple button to get the location... This is the current code I use in the onPress event handler in a dummy class: GeolocationStatus geolocationStatus = await Geolocator().checkGeolocationPermissionStatus();
if (geolocationStatus == GeolocationStatus.granted) {
Position position = await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
print('position $position');
} and this is the version of the package I'm using in geolocator: ^5.3.2+2 And these are the keys I have added to the <!-- ...skipped by brevity -->
<key>EnableBackgroundLocationUpdates</key>
<true/>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to location when open.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This app needs access to location when in the background.</string>
<key>NSLocationAlwaysAndWhenInUsageDescription</key>
<string>Always And In Use Permission</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs access to location when open and in the background.</string>
<!-- skipped by brevity... --> @mvanbeusekom any idea of what do you think I'm doing wrong? |
@mvanbeusekom, the link doesn't seem to work and other then this issue, I can't find any reference regarding |
@markbeij, correct the link mentioned was part of the 5.3.1 release. Currently we are on a much improved version 6.1.6 which has an updated folder structure to support the federated plugin architecture (which makes things easier to support multiple platforms). The current link to the README.md is: https://github.com/Baseflow/flutter-geolocator/blob/master/README.md The section regarding the background mode is:
This will basically add the |
🐛 Bug Report
Expected behavior
Expect to print the position, this is the code:
Geolocator geo = Geolocator();
Position pos =
await geo.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
print(pos);
Reproduction steps
It works on the Android emulator-position gets printed to console.
Doesn't work on iOS emulator, nothing gets printed and if I add another print statement after print(pos), it doesn't print either. I'm guessing it never got the position so its "await"ing forever?
Configuration
iPhone 11 emulator on Android studio
Version: 1.x
Platform:
📱 iOS
The text was updated successfully, but these errors were encountered: