diff --git a/Covid19Radar/Covid19Radar/ViewModels/HomePage/NotifyOtherPageViewModel.cs b/Covid19Radar/Covid19Radar/ViewModels/HomePage/NotifyOtherPageViewModel.cs index 04135f4cd..18b01c71d 100644 --- a/Covid19Radar/Covid19Radar/ViewModels/HomePage/NotifyOtherPageViewModel.cs +++ b/Covid19Radar/Covid19Radar/ViewModels/HomePage/NotifyOtherPageViewModel.cs @@ -159,6 +159,27 @@ public override void Initialize(INavigationParameters parameters) } } + public override async void OnAppearing() + { + base.OnAppearing(); + + // EN Enabled Check + var isEnEnabled = await exposureNotificationApiService.IsEnabledAsync(); + + if (!isEnEnabled) + { + loggerService.Warning($"Exposure notification is not enabled or activated."); + + await UserDialogs.Instance.AlertAsync( + AppResources.NotifyOtherPageDiag6Message, + AppResources.NotifyOtherPageDiag6Title, + AppResources.ButtonOk + ); + await NavigationService.NavigateAsync("/" + nameof(MenuPage) + "/" + nameof(NavigationPage) + "/" + nameof(HomePage)); + return; + } + } + public Command OnInqueryTelephoneNumberClicked => new Command(() => { loggerService.StartMethod();