如何在 xamarin.forms iOS 中配置 WkWebView? [英] How to configure WkWebView in xamarin.forms iOS?

查看:66
本文介绍了如何在 xamarin.forms iOS 中配置 WkWebView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,由于以下错误,我无法将我的新应用发布到 App Store:

<块引用>

ITMS-90809:已弃用的 API 使用 - 使用 UIWebView 的新应用程序不适用不再接受.相反,使用 WKWebView 来提高安全性和可靠性.了解更多(

解决方案

这似乎是 iOS 上 Xamarin.forms 的一个现有问题.

  1. 确保 Xamarin.Forms 版本为 4.7 或更高版本,Xamarin.iOS 版本为 13.10.0.17 或更高版本.
  2. 将链接器行为更改为仅 SDK 或链接所有,然后添加附加参数:--optimize=experimental-xforms-product-type请检查所有这些都已在发布下设置配置和 iPhone 平台.

有关更多详细信息,您可以参考https://devblogs.microsoft.com/xamarin/uiwebview-deprecation-xamarin-表格/

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

解决方案

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/

这篇关于如何在 xamarin.forms iOS 中配置 WkWebView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆