---
name: "offFileDownloadComplete"
mode: "kit"
versionRequirements:
  - { name: "P2PKit", version: "1.0.0" }
platform:
  - "iOS"
  - "Android"
async: true
title: "ty.p2p.offFileDownloadComplete - 取消监听：单文件下载完成事件"
---

## offFileDownloadComplete

> [VERSION] P2PKit >= 1.0.0

> [PLATFORM] iOS, Android

> ⚡ **支持 Promise 调用** — 不传 success / fail / complete 回调时，该方法返回 Promise。

### 描述

single file download completed event

### 参数

`(listener: Function)`

| 参数 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `listener` | `(params: FileDownloadCompletionEvent) => void` | 是 | - | 事件监听回调函数 |

### 引用对象

##### `interface` FileDownloadCompletionEvent

| 属性 | 类型 | 最低版本 | 描述 |
| --- | --- | --- | --- |
| `deviceId` | `string` | `1.0.0` | device id |
| `fileName` | `string` | `1.0.0` | file name |
| `index` | `number` | `1.0.0` | index |


### 示例代码

```tsx
const listener = function (res) { console.log(res) }
ty.p2p.onFileDownloadComplete(listener)
ty.p2p.offFileDownloadComplete(listener)
```
