crazyoxygen
crazyoxygen

Reputation: 716

how can I use repeatinterval every 10 minutes ??

Is there anyway to set local notification repeatinterval every 10 min.

I try to use

localnotification.repeatInterval = NSMinuteCalendarUnit*3;

and

localNotif.repeatInterval = 640;

and it don't work.

So could you guide me please. : )

Upvotes: 3

Views: 9521

Answers (4)

Parth Bhatt
Parth Bhatt

Reputation: 19469

I think you cannot do so.

I had asked similar question previously if you would like to refer to that question.

Here is the link

How to set Local Notification repeat interval to custom time interval?

Hope this helps you.

Upvotes: 2

Marcus Toepper
Marcus Toepper

Reputation: 2423

Wouldn'T you have to shedule your notification aswell? Like so

[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];

Upvotes: -1

rckoenes
rckoenes

Reputation: 69459

as Mundi said the repeatInterval has to be NSCalendarUnit and can only contain: NSWeekCalendarUnit, NSMonthCalendarUnit, NSDayCalendarUnit, NSHourCalendarUnit,..

So the get an notification every 10 min. Use 6 notification that repeat ever hour and set 10 minutes between the notifications.

Upvotes: 3

Mundi
Mundi

Reputation: 80265

The NSTimeInterval is in seconds, so ten minutes would be 600.0, not 640.

NSMinutesCalenderUnit has an arbitrarily defined value and does NOT contain the number of seconds per minute.

Did you check that you schedule the Notification properly with scheduleLocalNotification: and that you implemented application:didReceiveLocalNotification: in your AppDelegate?

Upvotes: 0

Related Questions