How to programmatically silence the ringer or change the ringer tone on iOS5

cfischer picture cfischer · Feb 17, 2012 · Viewed 8.1k times · Source

Is there a way to reduce the volume of the ringer or change the ringer tone on iOS5?

I checked out the Celestial framework, but can't instantiate AVSystemController. :-(

I don't care if this get's the app rejected in the AppStore as it will never be submitted.

Answer

edc1591 picture edc1591 · Feb 17, 2012

Yes. Use AVSystemController. You don't instantiate it. It's a singleton.

http://code.google.com/p/iphone-dev/source/browse/trunk/include/include/Celestial/AVSystemController.h?r=136

[[AVSystemController sharedAVSystemController] setVolumeTo:10.0 forCategory:@"Ringtone"];