> 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.

# fetchResourcePath

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

## 语法

### Android

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

#### 参数说明

- `request`: 请求所需资源。
- `callback`: 所需资源在磁盘上的路径。

:::note

- 此方法必须实现。

:::

### iOS

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

#### 参数说明

- `request`: 请求所需资源。
- `callback`: 所需资源在磁盘上的路径。

:::note

- 此方法必须实现。

:::

### Harmony

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

#### 参数说明

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

### Desktop (C++)

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

#### 参数说明

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

## 兼容性

**Compatibility Table**

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

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

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

**`fetch-resource-path`**

LynxEngine internally calls this method to obtain the path of the common resource on the local disk, and the return result is required to be of String type.

**Specifications:**

