So, I've implemented a Packet Tunnel Provider in order to create a custom VPN protocol, and it's working fine. However, If i change network's (i.e. switch from WiFi to LTE), the connection is lost. I thought "Well, I'll just wait till the connection drops and restart the provider", but in order for iOS to completely change adapters, it requires that all VPN providers are terminated.
So, I'm curious how I would restart the provider after the network has been changed. I've been unable to handle it in the primary application target since it would need to automatically restart even if the app is not open in the background, that way I don't have to re-connect to the VPN every time I leave the house and leave WiFi.
Any suggestions?