---
name: "getConnectedWifi"
mode: "kit"
versionRequirements:
  - { name: "BaseKit", version: "2.4.3" }
  - { name: "@ray-js/ray", version: "0.5.9" }
platform:
  - "iOS"
  - "Android"
async: true
---

## getConnectedWifi

> [VERSION] BaseKit >= 2.4.3 | @ray-js/ray >= 0.5.9

> [PLATFORM] iOS, Android

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

### Description

Get information about the currently connected Wi‑Fi. Note: On Android, location permission, Wi‑Fi state permission, and network permission are required; not available on iOS

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `partialInfo` | `boolean` | No | `false` | `2.4.3` | Whether to return partial Wi‑Fi information Android: If thing.getConnectedWifi is called with partialInfo:true, it returns a WifiInfo object containing only the SSID property. iOS: If thing.getConnectedWifi is called with partialInfo:true, it returns a WifiInfo object containing only the SSID and BSSID properties. Default: false |
| `complete` | `() => void` | No | - | - | Completion callback (executed on both success and failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `SSID` | `string` | `3.2.6` | Wi‑Fi SSID |
| `BSSID` | `string` | `3.2.6` | Wi‑Fi BSSID |
| `signalStrength` | `number` | `3.2.6` | Wi‑Fi signal strength. Android range: 0–100; iOS range: 0–1. Larger values indicate stronger signal. |
| `secure` | `boolean` | `3.2.6` | Whether the Wi‑Fi is secure Android: Supported starting from Android 12. |
| `frequency` | `number` | `3.2.6` | Wi‑Fi band in MHz |

#### 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` | Error extension code |
| `errorMsg` | `string` | Error extension message |


### Examples

#### Demo

```tsx
import { getConnectedWifi } from '@ray-js/ray'

getConnectedWifi({
  partialInfo: false,
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
