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

## getConnectedWifi

> [VERSION] BaseKit >= 2.4.3

> [PLATFORM] iOS, Android

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

### Description

Get info of the currently connected Wi-Fi. Note: Android requires location, Wi-Fi state, and network permissions; not available on iOS

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `partialInfo` | `boolean` | No | `false` | `2.4.3` | Whether to return partial Wi-Fi info On Android, thing.getConnectedWifi with partialInfo:true returns a WifiInfo object containing only the SSID property. On iOS, thing.getConnectedWifi with partialInfo:true returns a WifiInfo object containing only the SSID and BSSID properties. Default: false |
| `complete` | `() => void` | No | - | - | Callback invoked when the API call completes (runs on both success and failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | - | Success callback |
| `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 ranges 0–100, iOS ranges 0–1; higher values indicate stronger signal |
| `secure` | `boolean` | `3.2.6` | Whether Wi-Fi is secure Android: Supported from Android 12. |
| `frequency` | `number` | `3.2.6` | Wi-Fi frequency band, unit: 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` | Extended error code |
| `errorMsg` | `string` | Extended error info |


### Examples

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