---
name: "offDeviceMotionChange"
mode: "kit"
versionRequirements:
  - { name: "BaseKit", version: "2.3.2" }
platform:
  - "iOS"
  - "Android"
async: true
---

## offDeviceMotionChange

> [VERSION] BaseKit >= 2.3.2

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Stop listening for device orientation change events. If no parameters are provided, cancel all event listeners.

### Parameters

`(listener: Function)`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `listener` | `(params: Object) => void` | Yes | - | Event listener callback function |

##### offDeviceMotionChange.listener(params) properties

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `alpha` | `number` | Yes | - | `2.3.2` | When the device X/Y axes align with the Earth's X/Y axes, the rotation angle about the Z axis is alpha, range [0, 2*PI). Counterclockwise is positive. |
| `beta` | `number` | Yes | - | `2.3.2` | When the device Y/Z axes align with the Earth's Y/Z axes, the rotation angle about the X axis is beta, range [-PI, PI). Tilting the top toward the Earth's surface is positive; on some platforms, tilting toward the user may be positive. |
| `gamma` | `number` | Yes | - | `2.3.2` | When the device X/Z axes align with the Earth's X/Z axes, the rotation angle about the Y axis is gamma, range [-PI/2, PI/2). Rotating the right side toward the Earth's surface is positive. |
| `isParamCorrection` | `boolean` | Yes | - | `3.36.0` | iOS only, whether to correct the alpha value |


### Examples

```tsx
// Stop motion listening: register a listener first, then call offDeviceMotionChange to remove it (no args = remove all).
// Use the success callback of stopDeviceMotionListening at the end as the test-case completion signal
// (off removes the listener group; TTT needs an explicit callback to determine the end of the case).
ty.onDeviceMotionChange(e => console.log(e));

ty.offDeviceMotionChange();

ty.stopDeviceMotionListening({
  success: () => console.log("offDeviceMotionChange done"),
  fail: error => console.error(error),
});
```
