-
-
Notifications
You must be signed in to change notification settings - Fork 810
-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
_locationService.getLocation() not returning anything on iPad. #361
Comments
The localization service was enabled when requesting the localization? |
Yes, the service was enabled when I was trying. I checked before hitting the code, even tried manually on and off the service but no result. |
Same problem. |
I opened a pull request with the fix. PR: #362 |
@ZantsuRocks When can we expect the resolution? |
Same problem here for iPhone devices. I am doing a work around using the onLocationChanged |
Make sure you set the device location in xcode, if you don't getLocation() will never return. |
Same error here, running targetting iOS 10.0. For me does not work onLocationChanged aswell, tried a workaround with
But it still does not return anything #Edit I did manager to solve it: The problem was that I called a listener to listen changes of position and than I tried to call again .getLocation(), basically the sequence of events was: -> Instantiate Location and get once .getLocation() -> Returned the current location; To solve it I put a provider over my flutter application, and passed trough context my LocationHelper, where I stored lastPositionKnown, so now: -> Instantiate Location, get once .getLocation() and save it in lastPositionKnown; I don't know if this library has a lastPositionKnown, but It wouldn't be that bad to have it. |
@Hyla96 I have the same issue. The first time .getLocation() returns the current location but the second time it does not return anything. Would you be able to share the code for your solution? |
At the moment I'm not able to, but you can follow the following steps to workaround it: Create a LocationHelper class where you fetch and save location into a variable:
Now you place a Provider over your main app:
Now when you need your location instead calling it again you can call
I'm sorry but I've written it from my phone, just follow the logic and implement the code properly. You can also add a listener in your locationhelper in order to update the locationdata in case it changes. This worked great for me :) |
Here is my code. There is one issue. LocationHelper.dart:
main.dart
locationscreen.dart
|
Yeah I'm sorry, that should be a LocationData. However, you should modify that provider and turn it into a LocationHelper() and get the location in a initialization method, you are actually passing LocationData with that provider, and sound really awkward to me, because that's a future and weird things might happen. So:
|
@Hyla96 LocationHelper.dart:
main.dart
locationscreen.dart
|
What should the behaviour be when device location in xcode simulator is None? getLocation code hangs of me Is there a way to check location is None to avoid being blocked on the getLocation call? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
still not working on ios. |
Still not working on ios here !!!!!how to solve ??? |
Any updates? It still not working on iOS. Apple is rejecting my app because of this. |
I feeling that the gps feature on ios simulator is soooo broke compared to android simulator...it don't return the result while using custom location, and don't even have map to pick up location like android... |
Still an issue |
nailed it. this was my case. just removed the gps data stream and works. |
Still not working as it should. setInitialLocation is used in the splash
|
Describe the bug
The _locationService.getLocation() is not returning anything on Ipad mini wifi model.
The code gets to this line and after that, it never returns anything.
Expected behavior
_locationService.getLocation() should return location.
Tested on:
Additional logs
Code written
try { _locationService.changeSettings( accuracy: LocationAccuracy.HIGH, ); currentLocation = await _locationService.getLocation(); return true; } catch (e) { print(e); if (e.code == 'PERMISSION_DENIED') { _locationService.requestPermission(); } else if (e.code == 'SERVICE_STATUS_DISABLED') { _locationService.requestService(); } currentLocation = null; return false; }
The text was updated successfully, but these errors were encountered: