Cancelling single occurence of repeating local not

2019-02-19 11:30发布

问题:

I have scheduled repeating local notification for, let's say, 10.00 am. Repeat interval is one week. Is it possible to cancel programatically only single ocurrence of repeating notification? For example, it's 9.30 am, user has tapped checkbox and (programatically) cancelled notification, so it won't be displayed on 10.00, but will be displayed next week?

回答1:

It is not possible to cancel single occurrence of a repeating local notification. When you are scheduling a notification in repeating mode, you are creating one and only one notification even though it repeats. It counted as one. So what you can do is if the user tapped the switch cancel that notification and reschedule it in such a way that it will start from next week 10 am. If you need any help on that i will help you. Give a try first.