问题
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:
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.
来源:https://stackoverflow.com/questions/30737728/ui-local-notification-background-reschedule