I'm working on VPN for iOS. And i want to add ability to pause vpn to 5, 15 min and a hour. It means when user for example clicks on pause 15 min vpn disconnected and start connection in 15 min. But i don't understand how to schedule connection task. I tried to do it with Timer but timer stop working when app in background. I thought about BGTaskScheduler but how i understand in this case OS decides when start task and i will not be able to guarantee that i will start vpn connection in time. Also i thought about silent PUSH notifications but i not sure that it is a good solution. Can anyone suggest how can i solve this task more accurate?
Asked
Active
Viewed 44 times
0
-
[this answer](https://stackoverflow.com/a/61048308/9223839) might be helpful – Joakim Danielson Nov 11 '22 at 10:12