private async Task RemoveAllScheduledNotificationsAsync(Guid localAccountId) { string[] idsToRemove = await GetScheduledNotificationIdentifiersAsync(localAccountId); if (idsToRemove.Length > 0) { _notificationCenter.RemovePendingNotificationRequests(idsToRemove); } }
public async Task RemoveDailyReminders() { var allNotificationRequests = await NotificationCenter.GetPendingNotificationRequestsAsync(); var removableRequests = allNotificationRequests .Where(req => req.Content.CategoryIdentifier == DAILY_NOTIFICATIONS) .ToList(); NotificationCenter.RemovePendingNotificationRequests(removableRequests.Select(req => req.Identifier).ToArray()); }