Instance Method


Send a message to the Tunnel Provider extension. If the extension is not running, it should be launched to handle the message. If this method can’t start sending the message it reports an error in the returnError parameter. If an error occurs while sending the message or returning the result, nil should be sent to the response handler as notification.


- (BOOL)sendProviderMessage:(NSData *)messageData returnError:(NSError * _Nullable *)error responseHandler:(void (^)(NSData *responseData))responseHandler;



An NSData object containing the message to be sent.


If the message was sent successfully, this parameter is set to nil. Otherwise this parameter is set to the error that occurred. Possible errors include:

  • NEVPNErrorConfigurationInvalid

  • NEVPNErrorConfigurationDisabled


An optional block that handles the response from the Tunnel Provider extension. Pass nil if no response is expected.

Return Value

Returns YES if the message was sent successfully, or NO if an error occurred.


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