Is there a way to schedule a function which calls a web service at a particular time on a daily basis?
According to my research, I will have to use local notifications or NSTimer
to schedule or call the function at a specific time.
But I need this to work whether my application is in the background at the schedule time (and not running any background task), or in the foreground.
There are two cases:
1. Location service is running in the background in my application
2. No location or background service is running, or the app is in the suspended state (if the user disabled location updates)
But I have to send some status to my server at the scheduled time daily.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…