I'm trying to detect the "up volume" button on the device and run a method.
The next code works fine detecting the changes of the volume level, but when I'm on the highest level the selector isn't called (because the in the volume level doesn't occur any change)
AVAudioSession* audioSession = [AVAudioSession sharedInstance];
[audioSession setActive:YES error:nil];
[audioSession addObserver:self
forKeyPath:@"outputVolume"
options:0
context:nil];
Is there any workaround that I can do to detect the "up volume" button when the device has de highest level of volume?
Thanks
When the user changes the volume to the highest setting, instead of setting it to max, set it to MAX - some small amount. Then the callback will always be called because the volume can never be truly maxed out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With