public override async void Initialize(INavigationParameters parameters) { loggerService.StartMethod(); // Check Version AppUtils.CheckVersion(loggerService); try { await exposureNotificationService.StartExposureNotification(); await exposureNotificationService.FetchExposureKeyAsync(); var statusMessage = await exposureNotificationService.UpdateStatusMessageAsync(); loggerService.Info($"Exposure notification status: {statusMessage}"); base.Initialize(parameters); loggerService.EndMethod(); } catch (Exception ex) { Debug.WriteLine(ex.ToString()); loggerService.Exception("Failed to exposure notification status.", ex); loggerService.EndMethod(); } }
public override async void Initialize(INavigationParameters parameters) { // Check Version AppUtils.CheckVersion(); try { await exposureNotificationService.StartExposureNotification(); await exposureNotificationService.FetchExposureKeyAsync(); base.Initialize(parameters); } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } }
public override async void Initialize(INavigationParameters parameters) { loggerService.StartMethod(); // It seems the life cycle methods are not called after background fetch in iOS. // The days of use will be updated at this time. MessagingCenter.Unsubscribe <object>(this, AppConstants.IosOnActivatedMessage); MessagingCenter.Subscribe <object>(this, AppConstants.IosOnActivatedMessage, (sender) => { SettingDaysOfUse(); }); var startDate = userDataService.GetStartDate(); StartDate = startDate.ToLocalTime().ToString("D"); SettingDaysOfUse(); // Check Version AppUtils.CheckVersion(loggerService); try { await exposureNotificationService.StartExposureNotification(); await exposureNotificationService.FetchExposureKeyAsync(); var statusMessage = await exposureNotificationService.UpdateStatusMessageAsync(); loggerService.Info($"Exposure notification status: {statusMessage}"); base.Initialize(parameters); loggerService.EndMethod(); } catch (Exception ex) { Debug.WriteLine(ex.ToString()); loggerService.Exception("Failed to exposure notification status.", ex); loggerService.EndMethod(); } await localNotificationService.PrepareAsync(); }
public override async void Initialize(INavigationParameters parameters) { base.Initialize(parameters); loggerService.StartMethod(); // It seems the life cycle methods are not called after background fetch in iOS. // The days of use will be updated at this time. MessagingCenter.Unsubscribe <object>(this, AppConstants.IosOnActivatedMessage); MessagingCenter.Subscribe <object>(this, AppConstants.IosOnActivatedMessage, async(sender) => { await UpdateView(); }); // Check Version AppUtils.CheckVersion(loggerService); // Load necessary files asynchronous _ = exposureConfigurationRepository.GetExposureConfigurationAsync(); _ = exposureRiskCalculationConfigurationRepository .GetExposureRiskCalculationConfigurationAsync(preferCache: false); await localNotificationService.PrepareAsync(); await StartExposureNotificationAsync(); _ = Task.Run(async() => { try { await exposureDetectionBackgroundService.ExposureDetectionAsync(); } finally { await UpdateView(); } }); loggerService.EndMethod(); }