- Home /
 
How to properly remove a scheduled ios notification
I'm trying to implement notifications for ios using Unities Notification System package. When I create a notification I call this code.
  iOSNotificationCalendarTrigger trigger = new iOSNotificationCalendarTrigger()
             {
                 Year = time.Year,enter code here
                 Month = time.Month,
                 Day = time.Day,
                 Hour = time.Hour,
                 Minute = time.Minute,
                 Repeats = false
             };
 
             iOSNotification notification = new iOSNotification()
             {
                 Identifier = identifier,
                 Title = title,
                 Body = bodyText,
                 Subtitle = bodyText,
                 ShowInForeground = true,
                 ForegroundPresentationOption = (PresentationOption.Alert | PresentationOption.Sound),
                 CategoryIdentifier = "category_a",
                 ThreadIdentifier = "thread1",
                 Trigger = trigger
             };
             notifTracker.IosNotificationIDs.Add(notification.Identifier, notification.Title);//Add notification id to tracker
             iOSNotificationCenter.ScheduleNotification(notification);
 
               Using this I create a notification to go off in 5 minutes after the app is opened, but if the user clicks a button the notifications shouldn't be sent. To unschedule the notification I use this code:
 iOSNotificationCenter.RemoveScheduledNotification(id);
 
               But the notification is still being delivered. Am I doing something wrong on the API it says this function unschedules the specified notification.
I would appreciate any help, thank you.
Answer by Velcrohead · Nov 05, 2021 at 04:11 PM
@ZerotheLone did you find a fix for this? Currently having the same issue.
Your answer
 
             Follow this Question
Related Questions
How to know when my game is in background? 1 Answer
Unity NotificationServices 1 Answer
iOS Notifications Resume Game 0 Answers
MissingMethodException - Parse and iOS 64-bit 1 Answer
OnApplicationPause iOS: notification or home pressed? 0 Answers