> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# fetchTemplate

APISummary
`LynxEngine` internally calls this method to obtain the contents of Bundle and Lazy Bundle. The returned result type can contain `byte[]` or `TemplateBundle`.

## Syntax

### Android

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

#### Parameters

- `request`: Request for the requiring content file.
- `callback`: Response with the requiring content file: byteArray or TemplateBundle

:::note

- This method must be implemented.

:::

### iOS

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

#### Parameters

- `request`: Request for the requiring content file.
- `callback`: Response with the requiring content file: byteArray or TemplateBundle

:::note

- This method must be implemented.

:::

### Harmony

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

#### Parameters

- `request`: Request to obtain the contents of Bundle and Lazy Bundle
- `callback`: Response with the requiring content file in ArrayBuffer type.

## Compatibility

**Compatibility Table**

**Query:** `lynx-native-api.lynx-template-resource-fetcher.fetch-template`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-native-api/lynx-template-resource-fetcher/fetch-template.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| fetch-template | Yes (2.8) | Yes (3.4) | Yes (2.8) | No | No | No |

**`fetch-template`**

LynxEngine internally calls this method to obtain the contents of Bundle and Lazy Bundle. The returned result type can contain byte[] or TemplateBundle.

**Specifications:**

