Toasts.Forms.Plugin icon indicating copy to clipboard operation
Toasts.Forms.Plugin copied to clipboard

Unhandled Exception when using GetDeliveredNotifications method

Open bricegomis opened this issue 6 years ago • 0 comments

Hi,

I'm trying to get all notifications to delete some of them but when I'm using this code, I got a Exception:

var notifications = await _toastNotificator.GetDeliveredNotifications(); foreach (var notification in notifications) { Console.WriteLine(notification.Title); }

Unhandled Exception System.ArgumentOutOfRangeException: Value to add was out of range. Parameter name: value

I'm using the last version on nuget 3.3.2.

This error was also present with the 3.2.1 version.

In the source code, I think the problem comes from this line in NotificationBuilder.cs :

Delivered = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(notification.Notification.When)

I create the notifications with this code:

var options = new NotificationOptions { Title = call.CallLevel?.Name, Description = call.Subject, IsClickable = true, AndroidOptions = new AndroidOptions { SmallDrawableIcon = 2130903040// Defined Android Icon } }; `` _toastNotificator.Notify(options);

Do you have any idea why i'm getting this error ? Unfortunately, I can test only on Android, I cant update my Windows 10 with the last update.

bricegomis avatar Jun 25 '18 08:06 bricegomis