---
name: "offMemoryWarning"
mode: "kit"
versionRequirements:
  - { name: "BaseKit", version: "2.3.2" }
  - { name: "@ray-js/ray", version: "0.3.23" }
platform:
  - "iOS"
  - "Android"
async: true
title: "offMemoryWarning - 取消监听内存不足告警事件。"
---

## offMemoryWarning

> [VERSION] BaseKit >= 2.3.2 | @ray-js/ray >= 0.3.23

> [PLATFORM] iOS, Android

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

### 描述

取消监听内存不足告警事件。

### 参数

`(listener: Function)`

| 参数 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `listener` | `(params: Object) => void` | 是 | - |  |

##### offMemoryWarning.listener(params) 的属性

| 属性 | 类型 | 必填 | 默认值 | 最低版本 | 描述 |
| --- | --- | --- | --- | --- | --- |
| `level` | `number` | 是 | - | `2.3.2` | 内存告警等级，只有 Android 才有，对应系统宏定义 |


### 示例代码

#### Demo

```tsx
import { onMemoryWarning, offMemoryWarning } from '@ray-js/ray'

// 取消监听内存告警：需先有 onMemoryWarning 注册，offMemoryWarning() 不传参即取消全部监听
onMemoryWarning(e => console.log(e));
offMemoryWarning();
```
