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-native-api/lynx-generic-resource-fetcher/fetch-resource-path.md.
Lynx
  • 简体中文
  • fetchResourcePath

    LynxEngine 内部调用此方法以获取通用资源在本地磁盘上的路径,返回结果要求为 String 类型。

    语法

    Android

    public abstract void fetchResourcePath(
        LynxResourceRequest request, LynxResourceCallback<String> callback);

    参数说明

    • request: 请求所需资源。
    • callback: 所需资源在磁盘上的路径。
    Note
    • 此方法必须实现。

    iOS

    - (dispatch_block_t)fetchResourcePath:(nonnull LynxResourceRequest *)request
                               onComplete:(LynxGenericResourcePathCompletionBlock _Nonnull)callback;

    参数说明

    • request: 请求所需资源。
    • callback: 所需资源在磁盘上的路径。
    Note
    • 此方法必须实现。

    Harmony

    abstract fetchResourcePath(request: LynxResourceRequest, callback: AsyncCallback<string>): void;

    参数说明

    • request: 获取通用资源在本地磁盘上路径的请求。
    • callback: 包含所需资源在磁盘上的路径。

    Desktop (C++)

    virtual void FetchResourcePath(
        std::shared_ptr<lynx::pub::LynxResourceRequest> request,
        std::shared_ptr<lynx::pub::LynxResourceResponse> response);

    参数说明

    • request: 当前资源路径请求。
    • response: 由宿主填充的响应对象。

    兼容性

    LCD tables only load in the browser

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