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-template-resource-fetcher/fetch-template.md.
Lynx
  • 简体中文
  • fetchTemplate

    LynxEngine 内部调用此方法来获取 BundleLazy Bundle 的内容。返回结果类型可以包含 byte[]TemplateBundle

    语法

    Android

    public abstract void fetchTemplate(
        LynxResourceRequest request, LynxResourceCallback<TemplateProviderResult> callback);

    参数说明

    • request: 请求所需的内容文件。
    • callback: 响应所需的内容文件:byteArrayTemplateBundle
    Note
    • 此方法必须实现。

    iOS

    - (void)fetchTemplate:(LynxResourceRequest *_Nonnull)request
               onComplete:(LynxTemplateResourceCompletionBlock _Nonnull)callback;

    参数说明

    • request: 请求所需的内容文件。
    • callback: 响应所需的内容文件:byteArrayTemplateBundle
    Note
    • 此方法必须实现。

    Harmony

    abstract fetchTemplate(request: LynxResourceRequest, callback: AsyncCallback<TemplateProviderResult>): void;

    参数说明

    • request: 获取 BundleLazy Bundle 内容的请求。
    • callback: 以 ArrayBuffer 类型响应所需的内容文件。

    兼容性

    LCD tables only load in the browser

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