[iOS] Permissions.RequestAsync<Premissions.LocationWhenInUse> is getting main thread warnings - fix#29180
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the main thread warnings in Permissions.RequestAsync for iOS by removing the call to EnsureMainThread() in the tvOS/watchOS/iOS implementation.
- Removed an explicit main thread check that was causing warnings
- Proceeds directly to RequestLocationAsync for location authorization requests
Comments suppressed due to low confidence (1)
src/Essentials/src/Permissions/Permissions.ios.tvos.watchos.cs:137
- Removing EnsureMainThread() resolves the main thread warnings, but please double-check that RequestLocationAsync correctly handles any required main-thread operations to avoid potential issues with UI-related permission requests.
EnsureMainThread();
Contributor
|
Hey there @@kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Member
|
Do we have an idea why it was there in the first place @mattleibow @jfversluis ? |
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
I am not sure why tbh, it may have been a defensive thing. We should probably test this tho on older OS versions. Might have been something on older devices because it uses UI. |
jfversluis
approved these changes
Jun 26, 2025
PureWeen
pushed a commit
that referenced
this pull request
Jun 27, 2025
PureWeen
pushed a commit
that referenced
this pull request
Jun 28, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Issues Fixed
Fixes #29172