예제 #1
0
        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();
        }
예제 #2
0
        public override async void Initialize(INavigationParameters parameters)
        {
            loggerService.StartMethod();

            var startDate = userDataService.GetStartDate();

            StartDate = startDate.ToLocalTime().ToString("D");

            var daysOfUse = userDataService.GetDaysOfUse();

            PastDate = daysOfUse.ToString();


            // 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();
            }
        }