Is there any way to subscribe to volume buttons press events?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
After the recent rejections from Apple
Do not use this. Apple now uses some patch which would reject your app straightaway if it uses any of the private APIs – though should note here that quite some apps on the App Store use this already and are still there!
The only way to do this now is to have an AVAudioPlayer prepared to play but not playing ([player prepareToPlay]). This seems to take care of adjusting the app’s volume according to the rocker buttons.
There’s no other published way currently to handle this.
PLEASE READ THE ABOVE NOTE
Yes, Use the MPVolumeView
This will give you a slider (same as one used in ipod) whose value will change acc to volume of the phone
You will get a compile-time warning that view may not respond to _updateVolumeFromAVSystemControl, but just ignore it.