Fix state machine crashes & background tasks (#343)

* Fix `UIApplication.shared` after moving to SwiftUI app

* Do not autoplay videos on background

* Move app state changes into the app coordinator

* Add application background task, move into the suspended state more accurately

* Add changelog

* Fix most of the linter errors

* Strip suspended state from state machine

* Fix build

* Clear audio session warning

* Update AppCoordinator.swift

* Update AppCoordinator.swift

* Swift format
This commit is contained in:
ismailgulek
2022-11-28 18:42:49 +03:00
committed by GitHub
parent bd530333df
commit cb5db22b7f
10 changed files with 131 additions and 97 deletions
@@ -53,6 +53,7 @@ class UIKitBackgroundTask: BackgroundTaskProtocol {
// attempt to start
identifier = application.beginBackgroundTask(withName: name) { [weak self] in
guard let self else { return }
self.stop()
self.expirationHandler?(self)
}