Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Exception when using GetDeliveredNotifications method #159

Open
bricegomis opened this issue Jun 25, 2018 · 0 comments
Open

Unhandled Exception when using GetDeliveredNotifications method #159

bricegomis opened this issue Jun 25, 2018 · 0 comments

Comments

@bricegomis
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant