Instance Method

startVPNTunnelWithOptions:andReturnError:

Start the process of connecting the VPN

Declaration

- (BOOL)startVPNTunnelWithOptions:(NSDictionary<NSString *,NSObject *> *)options andReturnError:(NSError * _Nullable *)error;

Parameters

options

An NSDictionary that will be passed to the tunnel provider during the process of starting the tunnel. See Constants, below.

error

A pointer to a pointer to an NSError object. If specified and the VPN connection process cannot be started due to an error, this parameter will be set to point to an NSError object containing details about the error.

Return Value

YES if the process of connecting the VPN started successfully, NO if an error occurred.

Discussion

This method returns immediately after starting the process of connecting the VPN. In order to be notified when the VPN is fully connected, register to observe the NEVPNStatusDidChangeNotification notification on the NEVPNConnection object, and examine the status property when the notification is received.

See Also

Controlling the VPN Connection

- startVPNTunnelAndReturnError:

Start the process of connecting the VPN

- stopVPNTunnel

Start the process of disconnecting the VPN.

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