Search code examples
iosswiftaudiouilocalnotification

How to play UILocalNotification sound while do not disturb mode is on?


I can't seem to find a way to play the local notif sound when do not disturb is on, it's for an alarm clock app so it's kind of essential that the sound play even when do not disturb is on. Is there anyway around this?

As another option I've considered having a blank audio play in the background until I need the alarm called, but I've heard that Apple would reject this method.


Solution

  • Why would you need to play when the phone is in do not disturb mode? Chances are that if the user wanted to hear the alarm they would disable the do not disturb mode. I don't think there is a way to get around your problem.