For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/lynx-devtool-native-api/lynx-base-inspector-owner/send-message.md.
Lynx
  • 简体中文
  • sendMessage

    向通信对端(如 DevTool 桌面应用)发送一条指定类型的调试消息。

    配合 subscribeMessage 方法,支持双向通信。

    语法

    iOS

    LynxBaseInspectorOwnerNG.h
    - (void)sendMessage:(nonnull CustomizedMessage *)message;

    参数说明

    Android

    LynxBaseInspectorOwnerNG.java
    void sendMessage(CustomizedMessage message);

    参数说明

    Harmony

    LynxBaseInspectorOwner.ets
    sendMessage(type: string, message: string): void;

    参数说明

    • type: 要发送的消息类型,如 CDP 或其他自定义消息类型。
    • message: 要发送的消息数据。

    使用示例

    请参考 subscribeMessage

    兼容性

    LCD tables only load in the browser

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。