private async Task GetNotificaitonsCount() { var query = new NotificationQuery { Limit = 5, StartIndex = 0, UserId = AuthenticationService.Current.LoggedInUser.Id }; var summary = await _apiClient.GetNotificationsSummary(AuthenticationService.Current.LoggedInUser.Id); var notifications = await _apiClient.GetNotificationsAsync(query); }
private async Task GetNotifications() { if (!_navigationService.IsNetworkAvailable || _dataLoaded) { return; } SetProgressBar("Getting notifications..."); try { var query = new NotificationQuery { StartIndex = 0, UserId = AuthenticationService.Current.LoggedInUser.Id }; var notifications = await _apiClient.GetNotificationsAsync(query); Notifications = new ObservableCollection <Notification>(notifications.Notifications); await _apiClient.MarkNotificationsRead(AuthenticationService.Current.LoggedInUser.Id, Notifications.Select(x => x.Id), true); var summary = await _apiClient.GetNotificationsSummary(AuthenticationService.Current.LoggedInUser.Id); Messenger.Default.Send(new NotificationMessage(summary, Constants.Messages.NotificationCountMsg)); _dataLoaded = true; } catch (HttpException ex) { Log.ErrorException("GetNotifications()", ex); } SetProgressBar(); }