コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: NotificationManager.cs プロジェクト: akil03/bx
 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);
     });
 }
コード例 #3
0
 public override void OnEnter()
 {
     Notifications.CancelPendingLocalNotification(id.Value);
     Finish();
 }