0

My request is simple: how can I set a local notification to be given to the user at set times each day? So, for example, a notification is sent at 9a.m. each day.

I've tried looking around but nowhere seems to have what I want. They all seem to use date pickers and I'm no where near experienced enough with Obj-C to work around them.

Anything is appreciated.

3 Answers3

0

Have a NSTimer running in background with the interval of 60 sec. Get the current time for every minute . if the current time is equal to 9 am then show local notification .

Prabha
  • 424
  • 1
  • 4
  • 11
0

UILocalNotification has a couple of properties like repeatInterval or fireDate which may help you.

http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Reference/UILocalNotification_Class/Reference/Reference.html

But watch out, because you have some restrictions. Check this:

UILocalNotification Repeat Interval for Custom Alarm (sun, mon, tue, wed, thu, fri, sat)

Community
  • 1
  • 1
Yorxxx
  • 679
  • 3
  • 4
0

Using NSDateComponents and setting them as the fireDate appeared to work. Repeat that using repeatInterval.