VPN - guidelines MacOS

I've developed a VPN app for MacOS.

The user can press the connect or disconnect buttons to start/end the VPN connection.

The VPN is configured to be on-demand.


My question is -

What is the correct approach if the user press "connect", and then quit the app.

Should I disconnect the VPN?

And if I should disconnect the VPN, it will probably be at applicationWillTerminate func,

but how much time I have to do that?

Because I'll need to stop the VPN and change the ondemand to false, an action that take some time..

Accepted Reply

What is the correct approach if the user press "connect", and then quit the app. Should I disconnect the VPN?

Why do you think that’s a good idea? In general, VPN connectivity is not tied to the app that started it. For example, with the built-in VPN transports, you can connect from Settings but they don’t disconnect when you quit Settings.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

What is the correct approach if the user press "connect", and then quit the app. Should I disconnect the VPN?

Why do you think that’s a good idea? In general, VPN connectivity is not tied to the app that started it. For example, with the built-in VPN transports, you can connect from Settings but they don’t disconnect when you quit Settings.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Got it, thanks!