문제

I have problem with even inventing the posible solution for this problem.

My app needs to crate some objects of UILocalNotification with interval but if I set interval to be NSMinuteCalendarUnit if will bother me every minute until I cancel this notification in UIApplication or crash my phone with hammer...

But I'm setting in my app an end date for my project and I want those notification to work only to a specified date. Someone told me to check it when the app launches (not a problem but what if I set this notification to be fired every minute and I won't close my app during this time?). I need something independent and I want to know how to do this.. Any ideas?

도움이 되었습니까?

해결책

You could check if you need to cancel the local notification in receiving one when you app is running and on the start up of you app.

When your app is running in the foreground and a local notification is fired for you app the application:didReceiveLocalNotification: is called on your App delegate.

There is not end date for local notifications thus the only way you can cancel then is from you app when it is running.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top