How to implement a reminder calendar to my to-do list app?

365 views Asked by At

I would like to add to my To-DO list View Controller app a reminder calendar as there a user to be able to add a date and time and to get notified from notification centre at the moment when it comes out. I hope you could help! Thank you in advance!

1

There are 1 answers

0
Yaro On

Best way would be to Make a seperate "app extension" that sits in the notification center as a widget and communicates with your app.

Otherwise you have local notifications:

UILocalNotification *localNotification = [[UILocalNotification alloc] init];
            [localNotification setRepeatInterval:NSWeekCalendarUnit];
            [localNotification setFireDate:[date dateByAddingTimeInterval:interval]];
            [localNotification setTimeZone:[NSTimeZone defaultTimeZone]];
            [localNotification setSoundName:sound];
            [localNotification setAlertBody:WAKE_UP_TEXT];
            [localNotification setAlertAction:@"Open"];
            [localNotification setHasAction:YES];
            NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[uidOfObject copy] forKey:@"myNotificationID"];
            localNotification.userInfo = userInfo;
            [[UIApplication sharedApplication] scheduleLocalNotification:localNotification];