public async void Run(IBackgroundTaskInstance taskInstance) { BackgroundTaskDeferral _deferral = taskInstance.GetDeferral(); try { IStorageService storage = new StorageService(); if (storage.LoadLastUser()) { DpLogic dpLogic = new DpLogic(); ToastLogic toastLogic = new ToastLogic(); var notifications = await dpLogic.GetNotifications(); //toastLogic.ShowToast(notifications.First(), false); notifications = storage.SaveNotifications(notifications); notifications.ForEach(x => toastLogic.ShowToast(x, false)); } } catch (Exception) { } finally { _deferral.Complete(); } }