Forum General

WebView is not loading page

HemersonVarelaHemersonVarela USMember
edited February 6 in General

I have this very simple app

At mainPage.xaml file (just a WebView)

   <StackLayout>
       <WebView x:Name="Browser"
           HeightRequest="1000"
           WidthRequest="1000" />
   </StackLayout>   

At .cs file

   public MainPage()
   {
       InitializeComponent();
       NavigationPage.SetHasNavigationBar(this, false);
       Browser.Source = "https://apps.apple.com/us/app/payment-calculator/id760786888";
   }

but I noted that the web view page is not able to load links from the domain apps.apple.com (note that the protocol is https) other link work fine

On the console I can see below longs:

[ProcessSwapping] 0x1181de198 - ProvisionalPageProxy::ProvisionalPageProxy: pageID = 14 navigationID = 6 suspendedPage: 0x0
[ProcessSwapping] 0x1181de198 - ProvisionalPageProxy::didFailProvisionalLoadForFrame: pageID = 14, frameID = 1, navigationID = 6
[ProcessSuspension] 0x11815f840 - ProcessAssertion::processAssertionWasInvalidated()

Is there any way I can display links from domain apps.apple.com on a WebView?

Answers

  • soufianemarlysoufianemarly Member ✭✭

    try this

    in your Xaml

        <WebView x:Name="Browser" HorizontalOptions="Fill" VerticalOptions="Fill"  />
    

    in your cs

                var htmlSource = new HtmlWebViewSource();
                htmlSource.Html = app.Properties["cgu"].ToString();  //.  something like \n<p><strong>GPU</strong>\n<br
                if(app.Properties.ContainsKey("cgu"))
                    Browser.Source = htmlSource;
    

    hope this works for you

Sign In or Register to comment.