Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Prevent interrupting background audio from other apps on iOS launch

ashilkn9ed8827a8fb5
diff --git a/mobile/apps/photos/ios/Runner/AppDelegate.swift b/mobile/apps/photos/ios/Runner/AppDelegate.swift
index bd6537a952..5989096ac5 100644
--- a/mobile/apps/photos/ios/Runner/AppDelegate.swift
+++ b/mobile/apps/photos/ios/Runner/AppDelegate.swift
@@ -11,6 +11,17 @@ import workmanager_apple
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
+ // Prevent interrupting background audio from other apps on launch
+ do {
+ try AVAudioSession.sharedInstance().setCategory(
+ .ambient,
+ mode: .default,
+ options: [.mixWithOthers]
+ )
+ } catch {
+ print("Failed to configure initial audio session: \(error)")
+ }
+
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
}