6

I'm trying to write an application for the iPhone where the user will be notified of events such as deadlines. I am looking to override the silent mode and possibly have the notification sound loop until the user activates the application. Any info or documentation would be appreciated.

Thanks.

shim
  • 9,289
  • 12
  • 69
  • 108
Wallace
  • 89
  • 1
  • 1
  • 2
  • Who goes to the movies anymore, with all these yahoos and their cell phones going off? :> – Shaggy Frog Dec 16 '09 at 22:23
  • 10
    You guys misunderstood the question. He wants to build an app that makes alarms. The default alarm app in iPhone DOES play sound even with silent/manner switch on. If an alarm app couldn't alarm you with sound, it wouldn't be much of an alarm app. – Jonny Sep 08 '10 at 08:48
  • In order to allow critical alerts, a special entitlement must be applied for at Apple. This should be reopened. –  Jan 10 '19 at 04:06
  • yes you can override the silent mode, but you'll need an entitlement to do so because only "Critical notification" is allowed to breakthrough "Focus", and "Silent mode". There's a documentation in Human Interaction Guideline in Apple dev docs (Notification section) – Anthonius Nov 04 '21 at 02:22

3 Answers3

7

Overriding the OS sound settings in this manner, even if it were possible, would surely result in rejection during the review stages (if the reviewer caught this behaviour).

Think about what you're doing, and ask yourself if you think your user would appreciate this "feature". To me, the answer is clearly no.

Shaggy Frog
  • 27,575
  • 16
  • 91
  • 128
  • 2
    Actually I **really** would like this to be allowed in some cases. I use an alerting app that I want to wake me up if something breaks at work but it is unable to unless I un-silence. – BaroldGene Jan 03 '17 at 17:03
5

Apple tends not to permit activities that could be so easily used to abuse the user. If I enable silent mode, there's a reason.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
3

I'll give a tip on how I solved this problem, which may be a little different.

I was building an app where I wanted the user to be able to preview an MP3 clip, even if they had the phone on silent.

The way I went about this was first, importing the Audiobox framework <AVFoundation/AVFoundation.h> at the start of your file and then later in my code before I initialized my AVAudioPlayer I did:

[[AVAudioSession sharedInstance]
                setCategory: AVAudioSessionCategoryPlayback
                      error: nil];

Worked like a charm. It may not be what the OP needed, however.

Will
  • 1,697
  • 17
  • 34