I think I understand what you are saying; however, with the code I have above, wouldn't the task run after the app being closed for a minute? Note that NSTimeInterval is based on seconds, not minutes, so a value of 1 is one second, not one minute. or is there an error in that code? There isn't an error in your code as such; however, I think you've misunderstood what the API means. The key issue is here: request.earliestBeginDate = Date(timeIntervalSinceNow: 1) The earliestBeginDate property is the system’s earliest time the system is allowed to run your task. That is, if you set that interval to 3600 (1 hour in seconds), then the system guarantees that it won't run your task until at LEAST 1 hour from now. The key words there are at LEAST“ - that is, the system is ONLY guaranteeing that the work won't run BEFORE that time, NOT making any promises about when the work will fire AFTER that time. The thing to understand here is that the larger goal here is to let the system better manag
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags: