-
Notifications
You must be signed in to change notification settings - Fork 68
4. Repeat Notification
Elvin (Tharindu) Thudugala edited this page Jul 6, 2023
·
1 revision
To repeat a notification, notification must be Scheduled. You can Schedule notification by setting NotifyTime
in NotificationRequest
.
There are 3 repeat patterns, you can specify one of them by setting Repeats
in NotificationRequest
- Daily (Notification should repeat the next day at the same time)
- Weekly (Notification should repeat next week on same day, same time)
- TimeInterval (Notification to be delivered after the specified amount of time elapses)
if the pattern is TimeInterval you must set
NotifyRepeatInterval
inNotificationRequest
in iOS, not allowed delay and repeat when using TimeInterval
example
var notification = new NotificationRequest
{
NotificationId = 100,
Title = "Test",
Description = "Test Description",
Schedule =
{
NotifyTime = DateTime.Now.AddHours(1),
RepeatType = NotificationRepeat.TimeInterval,
NotifyRepeatInterval = TimeSpan.FromMinutes(2)
}
};
LocalNotificationCenter.Current.Show(notification);