handleAppMessage(_:completionHandler:)
Handle messages sent by the tunnel provider extension’s containing app.
Declaration
func handleAppMessage(_ messageData: Data, completionHandler: (@Sendable (Data?) -> Void)? = nil)func handleAppMessage(_ messageData: Data) async -> Data?Parameters
- messageData:
The message data sent by the tunnel provider extension’s containing app.
- completionHandler:
A block to be executed by the Tunnel Provider when it is finished handling the message. It may be nil, in which case the containing app does not expect a reply. The provider can send information back to the containing app via the
responseDataparameter.
Discussion
Use this method to communicate information between the Tunnel Provider and the Tunnel Provider’s containing app.