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

## offCompassChange

> [VERSION] BaseKit >= 2.3.2

> [PLATFORM] iOS, Android

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

### Description

Stop listening for compass data change events; if the parameter is empty, stop all event listeners

### Parameters

`(listener: Function)`

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

##### offCompassChange.listener(params) properties

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `direction` | `number` | Yes | - | `2.3.2` | Heading (degrees) |
| `accuracy` | `string` | Yes | - | `2.3.2` | Accuracy (returns differ between iOS and Android due to platform differences) Android:   high High accuracy   medium    Medium accuracy   low    Low accuracy   no-contact    Unreliable, sensor lost contact   unreliable    Unreliable, reason unknown   unknow ${value}    Unknown accuracy enum value; the accuracy value returned by this Android system is not a standard accuracy enum iOS:   double-type accuracy |


### Examples

```tsx
// Stop listening to the compass: set up listening with onCompassChange + startCompass, then call offCompassChange to remove it
ty.onCompassChange(e => console.log(e));
ty.startCompass({
  success: () => {},
  fail: error => console.error(error),
});
ty.offCompassChange(
  () => console.log("Stopped listening to compass"),
  error => console.error(error)
);
```
