How to run timer in background forever, I know from iOS 12 app gets only 30 seconds after it moved to background but I want to run app forever in background
Timer in background
This is not possible in the general case. If you can explain your high-level goal, we may be able to offer alternative paths.I want to run app forever in background
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Hi Eskimo,
Is there a way to run the timer in background for 3 minutes to logout from the server session? or is there any other possible approach to get an event after 3 minutes to perform logout while the app is in background?
Is there a way to run the timer in background for 3 minutes to logout from the server session? or is there any other possible approach to get an event after 3 minutes to perform logout while the app is in background?
Can you start a new thread for this? It’s clearly a different question than Kaikili’s and, even though they never responded, I’d prefer not to hijack their thread (-:Is there a way to run the timer in background for 3 minutes to logout
from the server session?
Tag it with BackgroundTasks so that I see it.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Sure, here - https://developer.apple.com/forums/thread/679132
Can't you just save the time when the timer started to core data or something and on app reopen fetch that and calculate time since for timer? That seems like an easier way.
And if you ever need to use the timer in background you can always fetch the date and calculate the difference fairly easily.