.Net MAUI iOS app - file upload inside WebView not uploading file

Arif uzzaman 10 Reputation points
2023-11-05T13:01:54.9433333+00:00

It's an .Net MAUI iOS app. Inside the app, I'm trying to run a web application inside WebView and after I select the image in Photo Library, it is not returns to page, just showing loading icon and doesn't upload the image. Android part work fine.

MainPage.xaml

<WebView Loaded="WebView_Loaded" 
	x:Name="myWebView"> 
</WebView>	

MainPage.xaml.cs

private void LoadWebView()
{
    myWebView.Source = "URL";
}

    protected override void OnHandlerChanged()
    {
        base.OnHandlerChanged();

#if ANDROID
        var webview = myWebView.Handler.PlatformView as Android.Webkit.WebView;
        webview.SetWebChromeClient(new myApp.Platforms.Android.MyWebChromeClient(MainActivity.Instance));

        if (webview is not null)
        {
            webview.Settings.MediaPlaybackRequiresUserGesture = false;
            webview.Settings.SetGeolocationEnabled(true);
            webview.Settings.JavaScriptEnabled = true;
        }
#endif

    }

Not sure what's setting do I need.

Thanks in advance.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,418 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 64,396 Reputation points
    2023-11-05T16:25:31.55+00:00

    You don’t show any code or error messages. Also be sure the web site the webpage loaded from and is uploading to is not having an error.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.