I am testing WebView in my Xamarin iOS app project. The WebView is coded like this:
<WebView
x:Name="WebView"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
android:WebView.EnableZoomControls="true"
android:WebView.DisplayZoomControls="false"
>
</WebView>
The WebView can display html:
WebView.Source = new HtmlWebViewSource
{
Html = "<!DOCTYPE html><html><body><p>Hello world</p></body></html>",
};
But when I use a URL:
WebView.Source = new HtmlWebViewSource() { BaseUrl = "https://www.google.com" };
or
WebView.Source = "https://www.google.com";
I only get a blank area.
I have added this to the info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
I don't handle any events such as Navigate, Navigating etc. Also, I am not overriding the WebView in this simple test.
The iPhone can display google.com and other sites when I open Safari.
What could the problem be?