
iOS SDK Volume
What's the best way to handle mute/unmute on iOS via the iOS native SDK?
What's the best way to handle mute/unmute on iOS via the iOS native SDK?
Hi,
My name is Daniel and I am an iOS SDK Support Engineer. Can you please provide me with context on what you are trying to accomplish? The volume is handled on the device level.
Thank you,
Daniel
When you launch the player I want to volume muted and controlled by custom user control. Currently I am doing: MPMusicPlayerController.applicationMusicPlayer().setValue(0, forKey: "volume") but that is not ideal.
Hi Derek,
Why is that not ideal? What would you envision as an ideal way to set the volume to mute?
Thanks,
Daniel
It pops the volume HUD
Hi Derek,
Thank you for responding. Just so I understand, you don’t like that the volume HUD pops up when a user changes the volume level?
I want to ensure I understand your ideal behavior.
Thank you,
Daniel
What I am trying to sort out is it appears that if your ringer is off, but music volume is on the audio is not present, is there a way around this?
Hi Derek,
Thank you for the clarification. The expected behavior for this situation is that if the phone is in silent the user would need to use headphones to hear the audio.
While it is technically possible to play audio while the phone is in silent mode, please note that Apple will reject your app during the submission process under Apple’s regulation 10.5 which states:
“Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, will be rejected.”
Here is a link to their guideline:
https://developer.apple.com/app-store/review/guidelines/
Please let me know if you have any other questions,
Daniel