Skip to content

Commit

Permalink
Skip DeviceDisplay.MainDisplayInfo on iOS 9
Browse files Browse the repository at this point in the history
  • Loading branch information
JunielKatarn committed May 2, 2021
1 parent e5999e0 commit 5a72952
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Forms/Views/MenuPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,17 @@ private async void OpenButton_Clicked(object sender, EventArgs e)

private async void AboutButton_Clicked(object sender, EventArgs e)
{
var mdi = "";
var version = "";
string mdi = "Unknown";
string version = "Unknown";
if (Device.GTK != Device.RuntimePlatform)
{
mdi = Xamarin.Essentials.DeviceDisplay.MainDisplayInfo.ToString();
version = Xamarin.Essentials.VersionTracking.CurrentVersion;
}
else
{
mdi = "Desktop";
version = "1.0";
//TODO: Log bug against Xamarin.Essentials (iOS 9.3.x)
if (Device.RuntimePlatform == Device.iOS && DeviceInfo.Version.Major > 9)
mdi = DeviceDisplay.MainDisplayInfo.ToString();

version = VersionTracking.CurrentVersion;
}

await DisplayAlert("Info", $"Unjammit! Version [{version}]\nDisplayInfo: [{mdi}]", "OK");
}
}
Expand Down

0 comments on commit 5a72952

Please sign in to comment.