Reputation: 1327
I have asked this question before, but have not received any real answer. How do iPhone developers, such as the developer of the Camera+ app, detect when the volume buttons are pressed and how do they prevent the system volume change. Please do not just link to an old answer unless it uses a way that is currently App Store safe. If anyone knows, help is greatly appreciated. Thank you!
Upvotes: 0
Views: 1538
Reputation: 78393
There is no App Store safe way to do it except to use the framework camera controls. When you use the standard controls, you get the volume controls for free. The reviewer may or may not let you go if you do it some other way, but officially you will be rejected unless you use the standard framework camera controls.
Upvotes: 1
Reputation: 2642
First off, becareful how you handle Hardware inputs, as you know if handle them incorrectly, you will get rejected from the app store
Secondly, read and learn Audio Session Programmming Guide this will help you understand how to handle hardware inputs, also here is the Audio Session Services Reference that will help you when it comes to programming the the listeners.
I can't give you code specific solution because you didnt elaborate where and when this is going to be used (in your app). Also where you handle the listener is up to you, so i have to leave it to you to figure out where to put your listener.
But a good resource is the apple developer library
Upvotes: 1