iOS VPN app automation issue

Guys, I’ve made simple automation which triggers VPN when you open the app and disconnects VPN after you leave the app. It works fine except the situation when I turn off iPhone screen having the app still open. After I turn on my iPhone again I’m still in the app but VPN is disconnected. I need to exit to homescreen, wait a bit and switch back to the app. Then VPN enables again.

Is there some workaround to keep VPN enabled after turning on the screen?

There are a number of reasons it might disconnect. The first thing to check with your VPN provider under what circumstances they might drop or explicitly terminate/time out a connection.

1 Like

OK, maybe I’ll rephrase my question then.
Is there a way to reconnect VPN upon powering on the iPhone again? Like check if I’m in the app which needs VPN connection.

You could have an open app automation set to turn VPN on so whenever you open that app it enables VPN

This is automation I already have. It breaks down when i turn off the screen.

That’s odd. So if you sleep the device, the VPN disconnects?

That isn’t all that odd on mobile devices. Many apps and services do it. See the link to the reasons post above.

VPN disconnects and after I power on the screen it does not reconnect. That is the issue.

Even when you have opened the app?

I described it in initial post. After powering on the screen I need to go to homescreen and back to the app. Then automation triggers again.

Ahh yes you’re right. I’ve always gotten into a habit of going to homescreen before my device locks / sleeps. But I can see where the issue would be for you. You could use a NFC automation to force your device to go to homescreen whenever it is unlocked. This can be achieved by putting NFC tag in your case

  • This would assume a case is available.
  • I imagine that this would preclude any other use of an NFC tag. Would it affect Apple Pay?
  • Don’t you have to bring an NFC tag into range for it to trigger? Otherwise sitting on an NFC tag would constantly trigger.
1 Like

It triggers when the screen wakes but after that it wouldn’t trigger.

I’ve never tested if it impacts Apple Pay but there is a possibility that it would

Potential, and untested, solution; link the VPN automation to a focus instead, so flow in automation would look something like:

When [VPN Filter] is on > Turn VPN [on] > open [app]


set the focus to be when the app is opened, and take out the open [app] part of the shortcut

then the reverse on turning the filter off,

Thanks. I’ve removed automation which disables VPN. So, now after 1st run of the app I have VPN connected. And I turn it off manually by shortcut on homescreen. Not so convenient but solves my issue with turning off VPN while pressing power button.