Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix(ios): keep background music playing during remote sessions (#16660)

Rafał Sikora398364fa187d
diff --git a/flutter/ios/Runner/AppDelegate.swift b/flutter/ios/Runner/AppDelegate.swift
index d9333b706..1c9e71b50 100644
--- a/flutter/ios/Runner/AppDelegate.swift
+++ b/flutter/ios/Runner/AppDelegate.swift
@@ -1,5 +1,6 @@
import UIKit
import Flutter
+import AVFoundation
@main
@objc class AppDelegate: FlutterAppDelegate {
@@ -8,6 +9,12 @@ import Flutter
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
+ do {
+ // Mix remote audio with other apps while still respecting silent mode.
+ try AVAudioSession.sharedInstance().setCategory(.ambient)
+ } catch {
+ NSLog("Failed to configure audio mixing: %@", error.localizedDescription)
+ }
dummyMethodToEnforceBundling();
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}