UI Local Notification - Background Reschedule

573 views Asked by At

I'm learning to develop application for ios with swift, and I'm one doubts, already googled and i not found.

I'm creating a to-do list app, and was wondering if there is a way to reschedule a notification when it appears to the user

For example the user registers a task every two hours, then the notification appears to the user and reagendo the new notification

Can anyone help me?

Thank you

1

There are 1 answers

1
Quentin Hayot On BEST ANSWER

You can't do it in background if your app is suspended. But UILocalNotification supports recurrent notifications.
All you have to do is to declare the recurring interval: notif.repeatInterval = NSDayCalendarUnit;

You can find more details here.

Note that you can't set custom intervals. You must use the default ones provided by Apple.