I need to run a timer in the background when my app is closed, however I have been reading that this isn't possible. I know that I can run it in the background for ~10 minutes, but I need considerably more than that (up to at least 2 hours).
I was wondering if there is a way to do this by saving the timer value when the app is closed, the current time, retrieving them when it re-opens, and comparing them to the current time to get the difference. I could then restart the timer and add the values together.
Anyone have any suggestions as to how I could do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…