Search code examples
iosobjective-cvpnnevpnmanager

How to delete or change VPN profile configs in ios Objective-C


in my app, I will fetch VPN profile config from server and create a VPN model. at first I easily install profile if there isn't previous profile config. but if profile config changed I have to change installed profile config such as server address and etc. how can I change or delete previous VPN profile or what's the best case to solve my problem?


Solution

  • NEVPNManager includes a removeFromPreferences API that you can use to remove your VPN configuration.

    If you change the profile (e.g. the protocolConfiguration), you can also call saveToPreferencesWithCompletionHandler:.