0

Is there any way to distinguish in the iOS app a situation that someone have changed volume by hardware buttons on iPhone/iPad from the situation that it has been done by some UI control in the app?

I have searched for that and so far I came up with many ways to be notified that the volume has been changed but there is no way to find out whether it was done by the UI control or hardware buttons. Notifications include info abut a reason of change but it is the same for both situations.

Julian
  • 9,299
  • 5
  • 48
  • 65
  • use this [link][1], you may get help [1]: http://stackoverflow.com/questions/14865317/hardware-volume-buttons-change-in-app-volume – Kumar C Jan 02 '14 at 13:06
  • look at this: http://stackoverflow.com/questions/772832/program-access-to-iphone-volume-buttons – Mariano Jan 02 '14 at 14:02
  • thanks for your attention, I saw it before posting. The problem is that I haven't found a way to differentiate between iOS notification when hardware button has been pressed from the notification sent after some UI interaction. I expected that it should be possible in a nice way provided by some iOS mechanism at receiving message level. It seems that it will require some workaround - when new volume will be set (and at this level recognise how it was triggered). – Julian Jan 02 '14 at 14:18

2 Answers2

2

After a long search I came up with this:

There is no way to detect hardware button been pressed (so far iOS 7). You can only be informed with the result - volume changed. It means that the only solution will be to properly handle situation when the volume change is triggered by some UI component.

Julian
  • 9,299
  • 5
  • 48
  • 65
0

You might want to have a look at the private API. rpetrich did some research again.. :) click here

But you need to know that this is not really a good idea because apple probably will reject your app when accessing private apis.

dehlen
  • 7,325
  • 4
  • 43
  • 71
  • I do not want to take a risk especially that with some update they can change internal structure and it will stop working or may even crash, thanks for try anyway – Julian Jan 03 '14 at 14:19