gpt4 book ai didi

xamarin.forms - ITMS-90809:不推荐使用的API-Apple将停止接受使用UIWebView API的应用程序的提交

转载 作者:行者123 更新时间:2023-12-02 05:48:09 31 4
gpt4 key购买 nike

我看到了其他一些标题相同的问题,但是我的问题有所不同。

昨天,我将我的应用程序上传到TestFlight,一段时间后,Apple向我发送了以下警告:

ITMS-90809:不推荐使用的API-Apple将停止接受使用UIWebView API的应用程序的提交。有关更多信息,请参见https://developer.apple.com/documentation/uikit/uiwebview

我正在使用WebView在我的应用程序中显示HTML数据。另外,我已经使用WebView播放音频和视频。那么,此警告是否会在提交审阅时拒绝我的应用程序,还是应该使用其他一些API更改这些功能?

在AppStore提供的link中,讲述了使用WKWebView而不是UIWebView的情况,我尝试了这一点,但在XAML上找不到此类属性。我是否需要安装任何软件包才能获得该功能?另外,通过使用WKWebView,是否可以在应用程序中播放音频,视频和显示HTML数据?

更新1

使用自定义渲染器时获取System.ArumentNullException。我想念什么吗?

enter image description here

更新2:渲染器代码
PCL

public class MyWebView : WebView
{
public static readonly BindableProperty UrlProperty = BindableProperty.Create(
propertyName: "Url",
returnType: typeof(string),
declaringType: typeof(MyWebView),
defaultValue: default(string));

public string Url
{
get { return (string)GetValue(UrlProperty); }
set { SetValue(UrlProperty, value); }
}
}

iOS上此类的自定义渲染器:
[assembly: ExportRenderer(typeof(MyWebView), typeof(MyWebViewRenderer))]
namespace WKWebViewDemo.iOS
{
public class MyWebViewRenderer : ViewRenderer<MyWebView, WKWebView>
{
WKWebView _wkWebView;
protected override void OnElementChanged(ElementChangedEventArgs<MyWebView> e)
{
base.OnElementChanged(e);

if (Control == null)
{
var config = new WKWebViewConfiguration();
_wkWebView = new WKWebView(Frame, config);
SetNativeControl(_wkWebView);
}
if (e.NewElement != null)
{
Control.LoadRequest(new NSUrlRequest(new NSUrl(Element.Url)));
}
}
}
}

XAML
<StackLayout>
<local:MyWebView Url="https://www.microsoft.com" VerticalOptions="FillAndExpand"/>
</StackLayout>

最佳答案

更新

此问题已解决,可以在以下答案中找到解决方案

ITMS-90909: Deprecated API Usage with iOS in Xamarin Forms app

这是Github上Xamarin.Forms的一个开放错误

截至目前,我在线程上看不到任何解决方法或任何东西,但是您可以等待Xamarin.Forms的下一版本修复它

更新:看到了一种可行的解决方法,请检查https://github.com/xamarin/Xamarin.Forms/issues/7323#issuecomment-527294907

关于xamarin.forms - ITMS-90809:不推荐使用的API-Apple将停止接受使用UIWebView API的应用程序的提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58515952/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com