setMessageHandler

Set a message handler to handle the custom message sent from sendMessage function

public func setMessageHandler(_ messageHandler: @escaping([String: Any]) -> Void)
  • messageHandler: the callback function to execute when a message is received from the WatchOS Companion app.