-
Notifications
You must be signed in to change notification settings - Fork 1k
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
bug: Geolocation.getCurrentPosition throws error on new permission dialog on iOS 14.2 #3789
Comments
@abarax Have you made any progress on this issue? I am getting the same error. |
@zsyphon Right now our workaround is to sit in a loop checking permissions using the query permission API (https://capacitorjs.com/docs/apis/permissions) Once the permission is recognised, only then do we use getCurrentPosition. I would love to dig in and figure out the cause here, I suspect something changed in the iOS operating system update. I actually think this was not happening on 14.2 beta as well, which is interesting. |
Looks like jcesarmobile has a fix though! |
It was happening on iOS 13 too, just took a bit longer to timeout. My PR should fix the problem. |
@jcesarmobile Thank you!! |
@abarax @jcesarmobile Thank you!! |
Having the same issue..
@abarax have you used this approach on ios as well? I'm getting this log: |
2.4.3 is out with this fix. |
@jcesarmobile this issue seems to persist in version
expected: |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Bug Report
Capacitor Version
Platform(s)
iOS 14.2
Current Behavior
Calling the getCurrentPosition API results in failure during the permission check on iOS 14.2 only. Seemingly the call times out after 2 seconds of waiting on the permission dialog. Console Output from XCode via emulator:
To Native -> Geolocation getCurrentPosition 80463459
APP INACTIVE
ERROR MESSAGE: {"message":"The operation couldn’t be completed. (kCLErrorDomain error 1.)","errorMessage":"The operation couldn’t be completed. (kCLErrorDomain error 1.)"}
⚡️ [error] - ERROR Error: Uncaught (in promise): Error: The operation couldn’t be completed. (kCLErrorDomain error 1.)
Expected Behavior
getCurrentPosition should wait until an option has been selected on the permission dialog.
Code Reproduction
Basic reproduction. Simply hit the 'test' button on tab 1 and you will see the above error in the xcode console.
https://github.com/abarax/capacitor-bug
Only Code added is here:
https://github.com/abarax/capacitor-bug/blob/main/src/app/explore-container/explore-container.component.ts
https://github.com/abarax/capacitor-bug/blob/main/src/app/explore-container/explore-container.component.html
To run:
Run via XCode using iOS 14.2 simulator
The text was updated successfully, but these errors were encountered: