问题
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.
回答1:
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"];
回答2:
This might be what you are looking for: Override ringer volume in iPhone apps
Basically, you set the volume using AVAudioPlayer on the -(void)viewDidLoad method of the view you are displaying on
来源:https://stackoverflow.com/questions/9320725/how-to-programmatically-silence-the-ringer-or-change-the-ringer-tone-on-ios5