flutter-geolocator
flutter-geolocator copied to clipboard
Not working on iOS 16
🔙 Regression
The plugin seems not work anymore on iOS 16, Xcode 14.
Old (and correct) behavior
Geolocator.isLocationServiceEnabled() was correclty getting the system service information.
Current behavior
Geolocator.isLocationServiceEnabled() throws
[CoreLocation] This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the
-locationManagerDidChangeAuthorization:
callback and checkingauthorizationStatus
first.
Reproduction steps
Compile the example with Xcode 14 and launch the app on iOS16 device.
Same here!
I get the same error message.
I'm using Flutter and have a button to bring me to current location which works my device but doesn't work when using the iPhone simulator. But I'm also getting this same error.
[CoreLocation] This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the -locationManagerDidChangeAuthorization:
callback and checking authorizationStatus
first.
Waiting for a possible solution. :)
Is this a duplicate of #1151?
I do see the same logs but the plugin is still able to fetch the localization on iOS 16 on my devices
I am unable to build my app. Is there a temporary solution?
is there any solution ?
anyone found the solution??
are we fucked?
This issue needs an urgent solution! Anyone got a solution?
@yzengin we all agree , i have tried to found another packages , but the issue showed on all of them , we end up our app and prepare it for launch and waiting to solve this to upload it the the appstore :( , such a disappointment thing
Needs urgent solution
Guys, make sure you added location permission to info.plist
@abdalmonem did you found a solution for this problem? we also have an app which is ready submit to store.
@dungnguyenBKA yes , looks the issue is not in the plugin it self , we can say its just xcode warning, a lot of time pass , but i remember , i delete the app , clean flutter project then clean x code (product>clean builder folder).
i used this dependencys :
geolocator: ^9.0.2 geolocator_apple: ^2.2.5 permission_handler: ^10.2.0
i copy this part from my project , and its work:
PermissionStatus permission = await Permission.locationWhenInUse.status; if (permission == PermissionStatus.denied) { await Future.delayed(Duration(microseconds: 200)); // i dont remember why there is delay here , if code works fine , try to remove it, maybe its reverent to permission = await Permission.locationWhenInUse.request(); Position position = await Geolocator.getLastKnownPosition(); Position newPosition = await Geolocator.getCurrentPosition(); }
in my info.plist:
<key>NSLocationAlwaysUsageDescription</key> <string>XXX app needs access to location when in the background.</string> <key>NSLocationWhenInUseUsageDescription</key> <string>XXX app needs access to location when open.</string>
for the permission handler , read : https://pub.dev/packages/permission_handler
you need to un comment : 'PERMISSION_LOCATION=1'