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
[Catalyst] Allow to use a custom WKUIDelegate on WebView #18483
Conversation
Do we have any tests for this - even for iOS? |
Line 31 should be || MacCatalyst, not && MacCatalyst. |
Yes. Use this project. Discussion was done in https://stackoverflow.com/questions/77170252/requestcapturemediapermission-for-wkwebview-in-maui-ios/77200328 |
I mean do we have any unit or device tests in Maui? The fact that this PR is green and the wrong condition means that we don't and should. All changes should have a test to ensure that it never breaks again. |
With current main repository, Line 15 on Platforms/iOS/WebViewUIDelegate.cs of this project https://github.com/tekmun/WebViewIssue.git will be called for iOS. I have not tested it on Mac though. Can someone test whether with the suggested changes, Line 15 on Platforms/iOS/WebViewUIDelegate.cs will be called on Mac/MacCatalyst? In theory, it should. If it works, then this project https://github.com/tekmun/WebViewIssue.git can be easily converted to become a unit test because it needs to ensure Line 15 on Platforms/iOS/WebViewUIDelegate.cs and Platforms/MacCatalyst/WebViewUIDelegate.cs are called. |
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Can this change make it into GA next week? |
This change is not destructive, meaning that it will not affect systems that are working now. It just allows the MacCatalyst app to have the same functionality as the iOS app. Please kindly merge the changes before GA next week. Thanks. |
Any updates on when the merging of this code into the main repository? |
Require a custom WKUIDelegate and handlers, already added a sample in the Gallery. |
Any updates on when the merging of this code into the main repository? |
It looks like the test case has been added and all checks have passed. Can the reviewers approve this request into the main branch? |
The requested change has not been reflected in the main branch. Why is request marked as DONE? |
Yay, build is passing. Could we get another review here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this
@@ -28,7 +28,7 @@ public partial class WebViewHandler : IWebViewHandler | |||
[nameof(WebViewClient)] = MapWebViewClient, | |||
[nameof(WebChromeClient)] = MapWebChromeClient, | |||
[nameof(WebView.Settings)] = MapWebViewSettings | |||
#elif __IOS__ | |||
#elif __IOS__ || MACCATALYST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this does anything in our code
Semi-confusingly
We already build everything marked as IOS for MACCatalyst
https://github.com/dotnet/maui/blob/main/src/MultiTargeting.targets#L99-L102
I'm not really sure what the users problem is but I don't think this will fix anything for them.
I don't quite understand on the repro, why they are setting the delegate inside a "BeginInvoke" call.
Like, if I check the type of the UIDelegate it's definitely already being replaced
Description of Change
Error with a simple fix that I have seen doing triage taking a look to new issues. Allow to use a custom
WKUIDelegate
on WebViewIssues Fixed
Fixes #18394