Reputation: 31
I am creating a bunch of notifications using ARC notification plugin for xamarin and all of them are sent immediately after I open the app despite the fact that I am setting the date and time at least one day away from the current date. My question is, how can I set up the Notification model so that I am receiving the notification at the specified date/time?
var notif = new Notification(){
Id = count++,
Date = item.PostDate.Date,
Title = item.Type.Equals(DayType.Duminica)
? item.Title
: $"{item.Title} {Helpers.GetCurrentDateOldFormat(item.PostDate.AddDays(-13))}",
Message = item.Content,
When = App.Settings.NotificationTime // new TimeSpan(08, 00, 00)
};
Upvotes: 3
Views: 344
Reputation: 1946
Try this, It will help you.
Send a scheduled notification:
App.Settings.NotificationTime = TimeSpan.FromDays(50);
var id = await CrossNotifications.Current.Send(
item.Type.Equals(DayType.Duminica) ? item.Title : $"{item.Title} {Helpers.GetCurrentDateOldFormat(item.PostDate.AddDays(-13))}",
item.Content,
when = App.Settings.NotificationTime);
For more information click here.
Upvotes: 1