diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/App.xaml.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/App.xaml.cs index 4b1c963354..588c72ab19 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/App.xaml.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/App.xaml.cs @@ -1,5 +1,4 @@ -//+:cnd:noEmit -[assembly: XamlCompilation(XamlCompilationOptions.Compile)] +[assembly: XamlCompilation(XamlCompilationOptions.Compile)] namespace Boilerplate.Client.Maui; @@ -8,15 +7,18 @@ public partial class App private readonly Page mainPage; private readonly IExceptionHandler exceptionHandler; private readonly IBitDeviceCoordinator deviceCoordinator; + private readonly IStringLocalizer localizer; public App(MainPage mainPage, IExceptionHandler exceptionHandler, IBitDeviceCoordinator deviceCoordinator, - IStorageService storageService) + IStorageService storageService, + IStringLocalizer localizer) { this.exceptionHandler = exceptionHandler; this.deviceCoordinator = deviceCoordinator; this.mainPage = new NavigationPage(mainPage); + this.localizer = localizer; InitializeComponent(); } @@ -33,6 +35,20 @@ protected async override void OnStart() base.OnStart(); await deviceCoordinator.ApplyTheme(AppInfo.Current.RequestedTheme is AppTheme.Dark); + + //+:cnd:noEmit + //#if (framework == 'net9.0') + //-:cnd:noEmit +#if Android + if (Version.TryParse(Android.Webkit.WebView.CurrentWebViewPackage?.VersionName, out var webViewVersion) && + webViewVersion.Major < 94) + { + await App.Current!.Windows.First().Page!.DisplayAlert("Boilerplate", localizer[nameof(AppStrings.UpdateWebViewThroughGooglePlay)], localizer[nameof(AppStrings.Ok)]); + await Launcher.OpenAsync($"https://play.google.com/store/apps/details?id={Android.Webkit.WebView.CurrentWebViewPackage.PackageName}"); + } +#endif + //+:cnd:noEmit + //#endif } catch (Exception exp) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx index 3e50922afc..0513c70b18 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx @@ -267,6 +267,12 @@ دستگاه نامشخص + + + لطفا وب ویو را از طریق Google Play آپدیت کنید + + + باشه diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx index 018620e1e8..061dbac268 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx @@ -267,6 +267,12 @@ Onbekend apparaat + + + Werk de webview bij via Google Play. + + + Ok diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx index 4e1830edec..a475dc2843 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx @@ -267,6 +267,12 @@ Unknown device + + + Please update webview through google play. + + + باشه