Commit b72726dc authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

audio: fix play in background

Set mix category to allow play ringtone when app is in background

Change-Id: I6e5d50b03981e185877dc99c6c916f16369b3aa6
parent 067e876a
......@@ -56,9 +56,9 @@ class AudioService {
func startAVAudioSession() {
do {
if #available(iOS 10.0, *) {
try AVAudioSession.sharedInstance().setCategory(.playAndRecord, mode: .default, options: [AVAudioSession.CategoryOptions.allowBluetooth])
try AVAudioSession.sharedInstance().setCategory(.playAndRecord, mode: .default, options: [AVAudioSession.CategoryOptions.allowBluetooth, AVAudioSession.CategoryOptions.mixWithOthers])
} else {
try AVAudioSession.sharedInstance().setCategory(.playAndRecord, options: [AVAudioSession.CategoryOptions.allowBluetooth])
try AVAudioSession.sharedInstance().setCategory(.playAndRecord, options: [AVAudioSession.CategoryOptions.allowBluetooth, AVAudioSession.CategoryOptions.mixWithOthers])
}
try AVAudioSession.sharedInstance().setActive(true)
} catch {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment