# pavex-react-native-wifi-manager

> Wifi manager methods for scanning

Latest version **0.0.7** (published 2017-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install pavex-react-native-wifi-manager
pnpm add pavex-react-native-wifi-manager
yarn add pavex-react-native-wifi-manager
bun add pavex-react-native-wifi-manager
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2017-06-08 |
| First published | 2017-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Pavel Macháček |
| Maintainers | pavex |

## Links

- npm: https://www.npmjs.com/package/pavex-react-native-wifi-manager
- Repository: https://github.com/Pavex/react-native-wifi-manager
- Homepage: https://github.com/Pavex/react-native-wifi-manager#readme
- Issues: https://github.com/Pavex/react-native-wifi-manager/issues
- npm.io page: https://npm.io/package/pavex-react-native-wifi-manager

## Recent versions

- 0.0.7 (latest) — 2017-06-08
- 0.0.6 — 2017-03-18
- 0.0.5 — 2017-03-18
- 0.0.4 — 2017-03-18
- 0.0.3 — 2017-02-07
- 0.0.2 — 2017-02-07
- 0.0.1 — 2017-02-07

## README

# Wifi manager for React Native

Wifi manager oriented for scanning existing networks. This supports list with scan and wifi enable checking and enabler.
This plugin now available for Android only.


## Installation

```
npm install --save pavex-react-native-wifi-manager
```

## Methods

#### `WifiManager.getScanResults();` 

Retrieves a list of the available networks as an array of objects.
Returned the following list structure:

```js
scanResult = [
    {   
        "SSID": ssid,                 // SSID as string
        "BSSID": bssid,               // MAC address of WiFi router as string
        "capabilities": capabilities, // Describes the authentication, etc.
        "frequency": frequency,       // frequency of the access point channel in MHz
        "rssi": rssi_level,           // Raw RSSI value
        "level": signal_level         // RSSI value in percent
    },
    {
        ...
    }
];
```

#### `WifiManager.startScan();` 

Call before getWifiList to retrieves current list of available networks.

#### `WifiManager.isEnabled();` 

Retrieves the current wifi status and passes `true` or `false` over Promise.

#### `WifiManager.setEnabled(enabled);` 

Enable or disable wifi service.


## Examples

Check if wifi service is enabled.
```js
WifiManager.isEnabled()
  .then((enabled) => {
    console.log('Wifi is enabled.');
  })
  .catch((error) => {
    console.warn(error);
  });
```

Scan available wifi networks

```js
WifiManager.startScan()
  .then((scanned) => {
     WifiManager.getScanResults()
       .then((scanResult) => {
         console.log(scanResult);
       })
       .catch((error) => {
         console.warn(error);
       });
    })
    .catch((error) => {
      console.warn(error);
    });
```

---
_Source: https://npm.io/package/pavex-react-native-wifi-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
