How to configure WkWebView in xamarin.forms iOS?

457 views Asked by At

Recently, I can't publish my new app to App Store due to the following error:

ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

Question 1, what is UIWebView and WkWebView? I can't even find a single word "UIWebView" in my project, how Apple knows I'm using it? The pages that I used are all xamarin based and Content Page only. You may refer to the code below in my xaml file.

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" >
    <StackLayout>

    </StackLayout>
</ContentPage>

That's it, no keyword "UIWebView".

Question 2, how to I set my entire project to WkWebView? I can't find any option in the settings page.

I've tried adding "--optimize=experimental-xforms-product-type" to Additional mtouch arguments in the iOS Build but no effect at all. Is there any other way? I just want to publish my app... enter image description here

1

There are 1 answers

2
Lucas Zhang On

This seems an existing issue of Xamarin.forms on iOS .

  1. Make sure that the version Xamarin.Forms is 4.7 or higher and Xamarin.iOS is 13.10.0.17 or higher.
  2. Change the Linker Behavior to SDK Only or Link All and then add the additional arguments: --optimize=experimental-xforms-product-type Please check all of these have been set under the release configuration and iPhone platform.

For more details you could refer https://devblogs.microsoft.com/xamarin/uiwebview-deprecation-xamarin-forms/