Hi
I am facing an issue on the WebView URL renderer on iOS after the render page displays blank and the same page will be visible on Android devices. On Url getting some console error like some images not working.
Below function is deprecated on iOS version or change method means if page not working or not renderer then how to display message in place of blank page.
webViewWebContentProcessDidTerminate
below the iOS custom view renderer.
[assembly: ExportRenderer(typeof(CustomWebView), typeof(CustomWebViewRenderer))]
namespace Yuro.iOS.Controls
{
/// <summary>
/// CustomWebViewRenderer
/// </summary>
public class CustomWebViewRenderer : ViewRenderer<CustomWebView, WKWebView>
{
/// <summary>
/// _wkWebView
/// </summary>
WKWebView _wkWebView;
/// <summary>
/// OnElementChanged
/// </summary>
/// <param name="e"></param>
protected override void OnElementChanged(ElementChangedEventArgs<CustomWebView> e)
{
try
{
base.OnElementChanged(e);
if (Control == null)
{
var config = new WKWebViewConfiguration();
config.AllowsInlineMediaPlayback = true;
config.MediaPlaybackRequiresUserAction = false;
_wkWebView = new WKWebView(Frame, config);
SetNativeControl(_wkWebView);
}
if (e.NewElement != null)
{
Control.LoadRequest(new NSUrlRequest(new NSUrl(Element.Url)));
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}
}