Post

Replies

Boosts

Views

Activity

Reply to How to send a simple request when HKObserverQuery triggered in background?
@DTS Engineer Hello, thank you for reply. No, there isn't a limitation or reason to use background URLSession. I am able to send requests with following code snippet while app is suspended: let urlsession = URLSession(configuration: URLSessionConfiguration.background(withIdentifier: "enablement"), delegate: self, delegateQueue: nil) let dataTask = urlsession.downloadTask(with: urlRequest) dataTask.resume() However, when I use this background urlSession with dataTask instead of downloadTask, it's doesn't work. To sum up, I couldn't find a task type which suits to my operation. I don't want a download, upload or time consuming operation. Using download task works but doesn't seem like the proper way to it. If this is wrong way to do, can you explain to me the proper way?
Oct ’24