1
votes

I have a webview inside my Xamarin Forms application which opens report downloaded from server in html format. Today I uploaded my archived application to app store and get information about ITMS-90809: UIWebView API Deprecation.

The problem is that I have no idea how to replace UIWebView with WKWebView in cross platform application. I've tried several solutions:

1) Creating Custom renderer for WebView - but this is no solution really because I need to inherit my new class by WebView superclass. So Apple warn me again with the same message.

2) Creating dependency service and use custom renderer in ios project only. But this is the same problem - there is still WebView reference in shared project.

So, is there any way to inject WKWebView directly to StackLayout in iOS? I know that WKWebView is iOS only and StackLayout is Xamarin.Forms component but really I don't have any idea how to do this.

Can anyone help me?

1
Would this help? forums.xamarin.com/discussion/129626/… looks like in the renderer it sets the component to be a WKWebView instead of a regular UIWebView.SomeStudent
This is my solution number 1. It is not working for meAdam Mrozek
But WebView when you're in Xamarin.Forms is just its representation of what is behind the scenes; I assume in your AssemblyInfo.cs it isn't set to this: [assembly: ExportRenderer(typeof(Xamarin.Forms.WebView), typeof(Xamarin.Forms.Platform.iOS.WebViewRenderer))] as that would switch it back to default UIWebViewSomeStudent

1 Answers

2
votes

There is an issue in Github you can follow: Deprecated API Usage UIWebView

WebViewRenderer in iOS implements UIWebView, and the file stays even if you switch over the WkWebViewRenderer. That's why you get the error message.

Xamarin team is working on it and it will fixed sometime in the future.

Also, there is an Apple statement says:

The App Store will no longer accept new apps using UIWebView as of April 2020 and app updates using UIWebView as of December 2020.

So you can still submit app with UIWebView right now and the error messgae is just a warning.

Relevant links: Make WkWebViewRenderer default for iOS WebView