How to configure WkWebView in xamarin.forms iOS?

被刻印的时光 ゝ 提交于 2021-01-29 11:35:24

问题


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...


回答1:


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/



来源:https://stackoverflow.com/questions/64369632/how-to-configure-wkwebview-in-xamarin-forms-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!