Skip to content

Instantly share code, notes, and snippets.

@cnnrrss
Created July 11, 2022 02:09
Show Gist options
  • Save cnnrrss/81762f7119eb228ddce66b18bc7888f2 to your computer and use it in GitHub Desktop.
Save cnnrrss/81762f7119eb228ddce66b18bc7888f2 to your computer and use it in GitHub Desktop.
import UIKit
import SwiftUI
import Firebase
import AVFoundation
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Get the singleton instance.
let audioSession = AVAudioSession.sharedInstance()
do {
// Set the audio session category, mode, and options.
try audioSession.setCategory(AVAudioSession.Category.playback)
} catch {
print("Failed to set audio session category.")
}
// Other post-launch configuration.
return true
}
}
struct LaceApp: App {
// MARK: - Properties
@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
init() {
FirebaseApp.configure()
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment