I'm making an HTTPS request that's initiated from a UNUserNotification action, so it performs with my app running in the background. I suspect that this feature isn't supported by Siesta, in which case I'll make a feature request! But first I want to see if I'm correct about that.
When I set up & make a request in the background using Siesta, no request appears to be made until I open my app, when I get a URLSessionTask
error code -1003 "HTTP load failed" with message: URL Session Task Failed: A server with the specified hostname could not be found.
.
This is the exact same behavior I see if I use plain URLSession
to make requests, without configuring the session for background execution using the boilerplate:
let config = URLSessionConfiguration.background(withIdentifier: String(format: "%f", Date().timeIntervalSinceReferenceDate))
config.isDiscretionary = isDiscretionary
config.requestCachePolicy = .reloadIgnoringLocalCacheData
config.sessionSendsLaunchEvents = true
config.timeoutIntervalForResource = backgroundTimeoutInterval
return URLSession(configuration: config,
delegate: self,
delegateQueue: .main)
Is there an out-of-the-box way to get this behavior in Siesta?