public void CancelPendingLocalNotification() { if (!InitCheck()) { return; } if (string.IsNullOrEmpty(idInputField.text)) { NativeUI.Alert("Alert", "Please enter the ID of the notification to cancel."); return; } Notifications.CancelPendingLocalNotification(idInputField.text); NativeUI.Alert("Alert", "Canceled pending local notification with ID: " + idInputField.text); }
void CancelNotification(NotificationContent notif, int seconds) { Notifications.GetPendingLocalNotifications(pendingNotifs => { try { var result = pendingNotifs.First(a => a.content.title == notif.title && a.content.body == notif.body && a.content.subtitle == notif.subtitle); if (result != null) { Notifications.CancelPendingLocalNotification(result.id); } } catch { } DateTime triggerDate = DateTime.Now + new TimeSpan(delayHours, delayMinutes, seconds); Notifications.ScheduleLocalNotification(triggerDate, notif); }); }
public override void OnEnter() { Notifications.CancelPendingLocalNotification(id.Value); Finish(); }