Post

Replies

Boosts

Views

Activity

Reply to URLSession background fails with timeout and not retrying after that
Sorry to dig up this old thread here, but I just stumbled across the question of how best to recreate the session when the app is launched, as this is only mentioned in the documentation as an aside. "Funny" enough, the sample code to create the session in the documentation is the following: private lazy var urlSession: URLSession = { let config = URLSessionConfiguration.background(withIdentifier: "MySession") config.isDiscretionary = true config.sessionSendsLaunchEvents = true return URLSession(configuration: config, delegate: self, delegateQueue: nil) }() Do you know of any sample code, which shows a good way of handling this?
Topic: App & System Services SubTopic: General Tags:
Feb ’22
Reply to URLSession background fails with timeout and not retrying after that
Sorry to dig up this old thread here, but I just stumbled across the question of how best to recreate the session when the app is launched, as this is only mentioned in the documentation as an aside. "Funny" enough, the sample code to create the session in the documentation is the following: private lazy var urlSession: URLSession = { let config = URLSessionConfiguration.background(withIdentifier: "MySession") config.isDiscretionary = true config.sessionSendsLaunchEvents = true return URLSession(configuration: config, delegate: self, delegateQueue: nil) }() Do you know of any sample code, which shows a good way of handling this?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’22