having a toggle to silence an iPhone's ringtone

Is it possible to create a toggle switch to silence an iPhone's ringtone in my app using swift?


If so, what is the line of code? Thank you for you feedback in advance!

Replies

That's not a great idea. Imagine, user wouldn't hear the ring phone, without muting intentionnally ?


Not even sure it would pass reviews.


Have a look at those discussions:

https://stackoverflow.com/questions/50737943/how-to-change-volume-programmatically-on-ios-11-4

and the strong warning NOT TO DO:

https://forums.developer.apple.com/thread/104078

Is it possible to create a toggle switch to silence an iPhone's ringtone in my app using swift?

No. If this were possible then it would allow for a discrepancy between the current mute behaviour and the state of the physical mute switch, which would be bad.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"