-1

I am working on a project which has alarm type of functionality. For which I am using "Reminder" default application for iOS.

Which is properly done by using below code:

EKEvent *event =[EKEvent eventWithEventStore:self.eventStore];
event.title =@"eventTitle";
event.calendar =self.calendar;    
event.startDate =  self.selectedTime; //set date
EKAlarm *alarm = [EKAlarm alarmWithAbsoluteDate:self.selectedTime];
[event addAlarm:alarm];
EKReminder *reminder = [EKReminder reminderWithEventStore:self.eventStore];
reminder.calendar = self.calendar;
// reminder.priority =1;
// reminder.
// [reminder setTimeZone:[NSTimeZone systemTimeZone]];
[reminder setAlarms:@[alarm]];

The problem is that the default sound of reminder is generally a beep or very low. I want to set the custom sound for the reminder programmatically. Is it possible to do that?

matt
  • 515,959
  • 87
  • 875
  • 1,141
ios developer
  • 3,363
  • 3
  • 51
  • 111

1 Answers1

1

Not with EKReminder. You are operating here through the Reminders app. The sound produced by a Reminders alarm firing is a user preference in the Settings app. It is up to the user, not you.

If you use a local notification (UNNotification) you can specify a sound (though even then the user can suppress it). That is what most reminder / alarm apps do. You should rethink your entire approach. Using EKReminder is not the way to write "a project which has alarm type of functionality".

matt
  • 515,959
  • 87
  • 875
  • 1,141