Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Delete unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
syoung-smallwisdom committed Sep 7, 2023
1 parent a10d7b9 commit d474360
Showing 1 changed file with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,35 +374,15 @@ extension BridgeURLSessionTask {
}
}

extension NotificationCenter {
func addObserver(forName name: NSNotification.Name, callback: @escaping @MainActor () -> Void) -> NSObjectProtocol {
addObserver(forName: name, object: nil, queue: .main) { _ in
Task {
await callback()
}
}
}
}

// Use a protocol to wrap the background network manager - this is to allow using a mock for testing.
protocol SharedBackgroundUploadManager : AnyObject {
@MainActor var isAppBackground: Bool { get }
var sessionDelegateQueue: OperationQueue { get }
func registerBackgroundTransferHandler(_ handler: BridgeURLSessionHandler)
@discardableResult func uploadFile(_ fileURL: URL, httpHeaders: [String : String]?, to urlString: String, taskDescription: String) -> Bool
func getAllTasks() async -> [BridgeURLSessionTask]
}

extension BackgroundNetworkManager : SharedBackgroundUploadManager {

@MainActor
var isAppBackground: Bool {
#if canImport(UIKit)
return UIApplication.shared.applicationState == .background
#else
return false
#endif
}
}

// Use a protocol to wrap the native upload manager - this is to allow using a mock for testing.
Expand Down

0 comments on commit d474360

Please sign in to comment.