How to use timer even after app closed

I’m using this method also but this is not working when screen back press or closed the app

I’m looking for method that works when app closed