1

I am making a local notification using UNCalendarNotificationTrigger. My goal is to repeat this notification every day at 8:54 PM.

For some reason, it always works the first time. However, when forwarding the system date on my Mac and testing in the simulator, it doesn't seem to ever trigger on a future / past date; only the current day. Does anyone have any experience testing future / past dates with this properly? Maybe I am doing something wrong.

Here is my code

```

NSDateComponents *comps = [[NSDateComponents alloc] init];
comps.hour = 20;
comps.minute = 54;

UNCalendarNotificationTrigger *trigger = [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:comps repeats:YES];

UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:@"Reminder" content:localNotification trigger:trigger];

```

asdasdasd
  • 19
  • 5
  • @matt Basically I am trying to make sure that it is firing every day at 8:54. So what I am doing is changing the date and time via System preferences to manually test it for multiple days – asdasdasd Nov 15 '17 at 02:17
  • @matt Although I am not sure if the notification cycle works that way and this is an accurate way of testing dates in the future.... – asdasdasd Nov 15 '17 at 02:18

0 Answers0