Instance Method

saveToPreferencesWithCompletionHandler:

Save the VPN configuration in the Network Extension preferences.

Declaration

- (void)saveToPreferencesWithCompletionHandler:(void (^)(NSError *error))completionHandler;

Parameters

completionHandler

An optional block that takes an NSError object. If specified, this block will be executed on the caller's main thread after the save operation is complete. If the configuration could not be saved to the preferences, the error parameter will be set to an NSError object containing details about the error. See NEVPN Errors for a list of possible errors. If the configuration is saved successfully then the error parameter will be set to nil.

Discussion

You must call loadFromPreferencesWithCompletionHandler:: at least once before calling this method the first time after your app launches.

See Also

Managing VPN Configurations

+ sharedManager

Access the single instance of NEVPNManager.

- loadFromPreferencesWithCompletionHandler:

Load the VPN configuration from the Network Extension preferences.

- removeFromPreferencesWithCompletionHandler:

Remove the VPN configuration from the Network Extension preferences.

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