We are already dealing with the automatic enabling and enabling of VPN on iPhone in the app settings. There is one drawback to this way – if you need to look at another application for a few seconds, the VPN will immediately turn off. When returning, we will again need to wait a few seconds until the connection is restored.
If you actively use several applications at the same time, the VPN will begin to slow down and at some point refuse to connect at all. There is a way to configure VPN shutdown with a delay of a few seconds, so that when quickly switching between programs it will not be implemented.
For the modified scripts we thank the guys from ioshortcut. Now let’s look at how to set everything up.
-
🙋♂️ Reply to any You can find a question about Apple here: https://t.me/iphonesru_forum👈
How to set the cost of turning on and off a VPN in iOS
1. Download the free Teams app.
2. download command: to enable VPN.
3. During the save step, select one of the standard VPN clients that will include this command.
4. download the second command to disable VPN.
5. At the save stage, select a delay start (default 20 seconds) and the same VPN that you selected for the previous command.
6. On the tab Automation create a new rule: Application → OpenSelect one or more applications to enable VPN when launched.
7. Enable the option Immediate launch and in the next step specify the command VPN on.
8. come up with a new rule: Application → Closedselect one or more applications that you specify for automation.
9. Enable the option Immediate launch and in the next step specify the command VPN off.
10. First, activate the downloaded scripts manually and grant the required permissions.
Now, when you launch the automation application, you will have the selected VPN profile selected. If you minimize the application or switch to another program, the VPN will not turn off immediately. This happened with the time delay set (default 20 seconds). If you return to the desired application during this time, the VPN will not turn on.
Source: Iphones RU

I am a professional journalist and content creator with extensive experience writing for news websites. I currently work as an author at Gadget Onus, where I specialize in covering hot news topics. My written pieces have been published on some of the biggest media outlets around the world, including The Guardian and BBC News.