Class

NEVPNManager

An object to create and manage a Personal VPN configuration.

Declaration

class NEVPNManager : NSObject

Overview

Personal VPN

The NEVPNManager API gives apps the ability to create and manage a Personal VPN configuration on iOS and macOS. Personal VPN configurations are typically used to provide a service to users that protects their Internet browsing activity on insecure networks such as public Wi-Fi networks.

Topics

Managing VPN Configurations

class func shared() -> NEVPNManager

Access the single instance of NEVPNManager.

func loadFromPreferences(completionHandler: (Error?) -> Void)

Load the VPN configuration from the Network Extension preferences.

func saveToPreferences(completionHandler: ((Error?) -> Void)?)

Save the VPN configuration in the Network Extension preferences.

func removeFromPreferences(completionHandler: ((Error?) -> Void)?)

Remove the VPN configuration from the Network Extension preferences.

Accessing VPN Configuration Properties

var isEnabled: Bool

A Boolean used to toggle the enabled state of the VPN configuration.

var protocolConfiguration: NEVPNProtocol?

An NEVPNProtocol object containing the configuration settings of the VPN tunneling protocol.

var `protocol`: NEVPNProtocol?

An NEVPNProtocol object containing the configuration settings of the VPN tunneling protocol.

Deprecated
var localizedDescription: String?

A string containing the display name of the VPN configuration.

var isOnDemandEnabled: Bool

A Boolean used to toggle the Connect On Demand capability.

var onDemandRules: [NEOnDemandRule]?

An ordered list of Connect On Demand rules

Connecting and Disconnecting VPN

var connection: NEVPNConnection

An NEVPNConnection object that is used to control the VPN tunnel specified by the VPN configuration.

Notifications

static let NEVPNConfigurationChange: NSNotification.Name

Posted after the VPN configuration stored in the Network Extension preferences changes.

Entitlements

Personal VPN Entitlement

The API an app can use to create and control a custom system VPN configuration.

Key: com.apple.developer.networking.vpn.api

Relationships

Inherits From

Conforms To

See Also

VPN Configuration

class NETunnelProviderManager

An object to create and manage the tunnel provider’s VPN configuration.

class NETunnelProviderProtocol

Configuration parameters for a VPN tunnel.

class NEAppRule

The identity of an app whose traffic is to be routed through the tunnel.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software