문제

I have a very weird problem. The volume button can only adjust the ringtone volume instead of volume inside my application. There must be a way to control it. Because I found some apps can adjust ringtone volume and some apps can adjust volume.

In another word how to category my app as an "music" app so that I can adjust eh playback volume instead of the ringtone volume when I press the hardware volume key.

Can somebody help? Thanks

도움이 되었습니까?

해결책

Use the following code will allow user to adjust the volume of play instead of ring tone.

AVAudioSession *session = [AVAudioSession sharedInstance];
[session setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top