Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to call web service and stop VPN server in applicationWillTerminate Method?

I have implemented VPN Server logic (NETunnelProviderManager) and start tunnel on NETunnelProviderSession using startTunnel(options: ["ipv4": dnsIpv4]) method. VPN Working fine and started properly. I want to stop VPN tunnel in applicationWillTerminate(_ application: UIApplication) method when application terminating. I have also put code logic for that but it will not stop VPN And I also want to call API (Web-service) when application going to terminate.



func applicationWillTerminate(_ application: UIApplication){

//Stop VPN

self.vpnService.disable { (error) in

}

//Perform API Calling

self.myAPI()

}

iPhone 6s, iOS 10.1

Posted on Dec 13, 2017 6:40 AM

Reply

There are no replies.

How to call web service and stop VPN server in applicationWillTerminate Method?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.