At the moment, when I call and try to change the volume with UI elements, I only see the UI change, the volume slider change, but not the device volume. The volume is static. For volume changing I'm using MPVolumeView
static func adjustCurrentVolume(_ volume: Float) {
let volumeView = MPVolumeView()
guard let slider = volumeView.subviews.first(where: { $0 is UISlider }) as? UISlider else { return }
if volume > maximumVolume {
currentVolume = maximumVolume
} else if volume < minimumVolume {
currentVolume = minimumVolume
} else {
currentVolume = volume
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
slider.value = currentVolume
}
}
For Call: SinchRTC and CallKit. The AudioSession during a call is in the PlayAndRecord category and VoiceChat mode.