restorePersistenceManager() is present in singleton class . So the session gets created in init method and delegate get set here
override init() {
super.init()
bitrate = SettingsManager.shared.downloadQuailty ?? 9728000.0
// streamManager = StreamManager()
// Create the configuration for the AVAssetDownloadURLSession.
let backgroundConfiguration = URLSessionConfiguration.background(withIdentifier: "unique-Identifier")
// Create the AVAssetDownloadURLSession using the configuration.
assetDownloadURLSession =
AVAssetDownloadURLSession(configuration: backgroundConfiguration,
assetDownloadDelegate: self, delegateQueue: OperationQueue.main)
}