Open kuhnroyal opened 3 years ago
Hi @kuhnroyal
Thanks for filling this issue. I was able to reproduce it.
If you would like, I think Baseflow would love to see your PR!
I can't reproduce the issue on iOS14+, is this still an issue @kuhnroyal ?
I will try to test this again next week.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
Sorry for the late reply, it seems the issue no longer occurs. Not sure what exactly fixed this, maybe the library is not allowing the app to go in background now.
Re-opening this issue as @FelipeAndresLopez confirmed the issue is still occurring on recent versions of iOS.
Still happening as of now.
I'm still having this issue in ios 16.2, any idea how to fix this? was there an option to cancel when get this exception PermissionRequestInProgressException ?
@frendcarlo yes we need to comment the native ios code inside plugin. open the file PermissionHandler.m and comment the return in lineno. 57 / (open the project in xcode and search the string "A request for location permissions is already running, please wait for it to complete before doing another request." and comment the return in lineno. 57)
Is there any updates? We have also the same issue.
I do not know why, but this event did not occur when launching the example app from Xcode instead of from Android Studio.
Currently, the policy is not to request again if the authorization request process is already running. https://github.com/Baseflow/flutter-geolocator/blob/c7dffa16311f5caf6ee3e48733be219183be9cf3/geolocator_apple/ios/Classes/Handlers/PermissionHandler.m#L46
However, considering the case where the location authentication on the iOS side does not return, the following option is better:
I've tested the following on iOS 16.6 en it seems to work as expected:
Run example app; request a permission like camera; click the power button to switch off the screen; click the power button to switch on the screen( wait 30 + seconds); Log into your iPhone; The Alert reopens. (multiple times)
If this issue still occurs please inform us about detailed steps to reproduce and probably OS version.
But there are multiple issues regarding the PermissionRequestInProgressException. I've reproduced it before only on a Simulator.
Kind regards,
I've reproduced it with location permissions indeed. I'll label it as a bug. However, I'm not sure if it is a bug from the plugin. Related to: https://github.com/Baseflow/flutter-permission-handler/issues/783
Kind regards,
Commenting here to give #1217 some more exposure. This PR might fix the bug mentioned.
This still happens, has it been fixed yet?
🐛 Bug Report
On iOS, when the app goes to background while the permission dialog is showing (due to pressing power button or display timeout, usually for 30+ seconds or so) and the phone is activated again, the permission dialog is gone. Afterwards it is not possible to request a permission again because it will always throw
PermissionRequestInProgressException
.Expected behavior
The plugin should detect this case and ensure that the permission can be requested again. Somehow the
confirmationHandler
needs to be cleaned up here: https://github.com/Baseflow/flutter-geolocator/blob/master/geolocator/ios/Classes/Handlers/PermissionHandler.m#L37Reproduction steps
Geolocator.getCurrentPosition()
)Version: 6.1.4
Platform: