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

## getCurrentVolume

> [VERSION] BaseKit >= 2.4.3

> [PLATFORM] iOS, Android

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

### Description

Get the current system volume. Note: On Android, system volumes are categorized; this API returns the phone ringtone volume. To get other system volume values, use the getCurrentVolumeByMode API.

### Parameters

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `complete` | `() => void` | No | - | Completion callback (runs on success and failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | Callback for API call success |
| `fail` | `(params: Object) => void` ↓see below | No | - | Callback for API call failure |

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `value` | `number` | `3.2.6` | Volume, range [0 - 1] |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extension |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Extended error code |
| `errorMsg` | `string` | Extended error info |


### Examples

```tsx
ty.getCurrentVolume({
  success: data => {
    console.log(data.value);
  },
  fail: error => {
    console.error(error);
  },
});
```
