iOS10AdaptationTips icon indicating copy to clipboard operation
iOS10AdaptationTips copied to clipboard

UILocalNotification vs UNNotificationRequest

Open mohan-shyam opened this issue 9 years ago • 2 comments

Now while we use the new notifications framework, repeats option is Boolean.

var trigger = UNTimeIntervalNotificationTrigger.withTimeInterval(5.0, repeats: false)

But earlier, in UILocalNotification, we could specify different repeatIntervals.

localNotification.repeatInterval = .Minute

localNotification.repeatInterval = .Month

Is there a way to do that in the new framework?

mohan-shyam avatar Sep 28 '16 10:09 mohan-shyam

@mohan-shyam Perhaps, your problem could be solved with UNCalendarNotificationTrigger. See https://developer.apple.com/reference/usernotifications/uncalendarnotificationtrigger

hokim-m avatar Nov 18 '16 13:11 hokim-m

@hokim-m , thank you. I seem to have arrived at a solution, although there are many situations which can't be implemented with the new framework.

Please find the solution at, http://stackoverflow.com/questions/37804287/how-do-i-set-an-nscalendarunitminute-repeatinterval-on-ios-10-usernotifications/39784684#39784684

mohan-shyam avatar Nov 18 '16 15:11 mohan-shyam