diff --git a/crates/apps/metronome/ios/Runner/AppDelegate.swift b/crates/apps/metronome/ios/Runner/AppDelegate.swift index b18e2b5c759..78e5f8aede2 100644 --- a/crates/apps/metronome/ios/Runner/AppDelegate.swift +++ b/crates/apps/metronome/ios/Runner/AppDelegate.swift @@ -1,5 +1,16 @@ import UIKit import Flutter +import AVFAudio + +func configureAudioSession() { + let audioSession = AVAudioSession.sharedInstance() + do { + // Set the audio session category and mode. + try audioSession.setCategory(.playback, mode: .default, options: [.mixWithOthers]) + } catch { + print("Failed to set the audio session configuration") + } +} @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { @@ -9,6 +20,9 @@ import Flutter ) -> Bool { let value = dummy_method_to_enforce_bundling() print(value) + + configureAudioSession() + GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) }