Playing alarm in iphone with EKEvent

4.7k views Asked by At

I am working on application which stores event using EKEvent class and I want my application to fire alarm when that event occurs. I don't know how to play alarm in iPhone.

1

There are 1 answers

4
Krishnabhadra On BEST ANSWER

I think you can manipulate this code to play alarm using EKEvent..

NSMutableArray *myAlarmsArray = [[NSMutableArray alloc] init];

EKAlarm *alarm1 = [EKAlarm alarmWithRelativeOffset:-3600]; // 1 Hour
EKAlarm *alarm2 = [EKAlarm alarmWithRelativeOffset:-86400]; // 1 Day

[myAlarmsArray addObject:alarm1];
[myAlarmsArray addObject:alarm2];

event.alarms = myAlarmsArray;
[myAlarmsArray release];

I think this small blog post will be useful to you...Hope this helps...cheers