Repository navigation
fix(ios): resolve requestPermissions for geolocation once the user answers - #183
Open
andredestro wants to merge 1 commit into
Open
andredestro wants to merge 1 commit into
andredestro wants to merge 1 commit into
Conversation
andredestro
marked this pull request as ready for review
October 27, 2026 10:51
andredestro
requested review from
ItsChaceD,
OS-pedrogustavobilro,
OS-ruimoreiramendes,
alexgerardojacinto,
jcesarmobile,
markemer and
theproducer
October 27, 2026 10:51
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
BackgroundRunner.requestPermissions({ apis: ['geolocation'] })never resolves on iOS. The location dialog is shown and answered, but the promise stays pending (the console stops atgeolocation requested...).requestPermissionsruns inside aTask, soCapacitorGeolocationcreates itsCLLocationManageron a Swift concurrency thread. Core Location delivers delegate callbacks on the run loop of the thread that created the manager, and that thread has no run loop, solocationManagerDidChangeAuthorizationnever fires and the continuation is never resumed.Changes:
CLLocationManagercreated on the main thread, so its delegate callbacks are delivered.locationManagerDidChangeAuthorizationignores the initial callback while the status is stillnotDetermined(it fires as soon as the delegate is set) and resumes only once the user has answered.Tracked in RMET-5551.
Verification
notDetermined):requestPermissionsnow resolves after the user answers, logginggeolocation requested...doneand returning{"geolocation":"granted","notifications":"granted"}. Before this change it never resolved.nextwith this same patch applied, because themainexample app can't launch with the iOS 27 SDK (it doesn't use UIScene). The code in this file is the same on both branches, apart from formatting.