xamarin ios blank screen

David Eberle 21 Reputation points
2022-03-23T13:13:39.81+00:00

Hello.
I have a very simple app in Xamarin that only has a webview, which works fine on android, but when I upload it to the apple store it tells me that it only shows a blank screen:

Guideline 2.1 - Performance - App Completeness

We discovered one or more bugs in your app. Specifically, a blank screen was displayed upon launch. Please review the details below and complete the next steps.

Review device details:

  • Device type: iPad
  • OS version: iOS 15.4

Next Steps

Please run your app on a device to reproduce the issues, then revise and submit your app for review. If at first you're unable to reproduce the issue, try the following:

  • For new apps, uninstall all previous versions of your app from a device, then install and follow the steps to reproduce.
  • For app updates, install the new version as an update to the previous version, then follow the steps to reproduce.

If we misunderstood the intended behavior of your app, please reply to this message in App Store Connect to provide information on how these features were intended to work.

Resources

  • For information about testing apps and preparing them for review, see Technical Note TN2431: App Testing Guide.
  • To learn about troubleshooting networking issues, see About Networking.

Run the test on https://appcenter.ms/, and I also see a blank screen.

I added this in info.plist:

   <key>NSAppTransportSecurity</key>
        <dict>
            <key>NSAllowsArbitraryLoads</key>
            <true/>
        </dict>

MainPage.Xaml

  <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 x:Class="APPNotions.MainPage">

        <WebView x:Name="Navegador" Navigating="Navegador_Navigating" HorizontalOptions="FillAndExpand"
        VerticalOptions="FillAndExpand"></WebView>

    </ContentPage>

MainPage.xaml.cs

public MainPage(string url = null)
        {
            InitializeComponent();


            if (string.IsNullOrEmpty(url))
            {
                Navegador.Source = Config.urlLogin;
            }
            else
            {
                Navegador.Source = url;
            }
        }

async void Navegador_Navigating(object sender, WebNavigatingEventArgs e)
        {
            if (e.Url.Contains("logout"))
            {
                OneSignal.Default.SendTag("tokenUsuario", "logout");
                Navegador.Source = Config.urlLogin;
            }
            if (e.Url.Contains("token"))
            {
                string token = e.Url.Split(new string[] { "token=" }, StringSplitOptions.None)[1];
                OneSignal.Default.SendTag("tokenUsuario", token);
            }
            if (e.Url.Contains("target=browser") || e.Url.StartsWith("tel:"))
            {
                try
                {
                    await Launcher.OpenAsync(new Uri(e.Url));
                    e.Cancel = true;
                }
                catch
                {

                }
            }
        }
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
{count} votes