We have been developing an app and recently tested on different devices and found an issue with a web container. The first time we load the web page it's fine and views/works fine, when we come to load it a second time we have a white screen. We need to re-start the app to re-load the web container and we can never recover the web container to view the web site.
It seems to only do it on certain phones, such as example we can view the web page on a Samsung phone but cannot view the web page on a Nokia phone. The code has been based on the example from Xamarin and it's so simple it's hard to what is going on. The page is held on a secure sever, so we obtain the token at login and we know the token is fine and is not we do not lose the token else were in the code.
Another issue is we have different web pages within the app, once we view this web page using the code below it kills the web container and we cannot view any different web pages, again we have to re-start the app to view the web site.
Does any one have any suggestion would could be wrong, why does the web container only work on certain phones and it crashes the web container so no other pages can be viewed?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace webcontainercheck
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class webformview : ContentPage
{
public webformview()
{
//InitializeComponent();
string token = sessionid.getToken();
var url2 = "https://www.companylink.com/auth/dataset/" + token + "/";
var browser = new WebView() { WidthRequest = 1000, HeightRequest = 1000, Source = url2};
//browser.Reload();
//browser.Source = url2;
Content = browser;
}
}
}

Aucun commentaire:
Enregistrer un commentaire