🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-native-wifi-connect

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-wifi-connect

Connect Wifi Local Only Hotspot

0.3.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

react-native-wifi-connect

Interconnect WiFi

Installation

yarn add react-native-wifi-connect

Usage

import {
  wifiSwitch,
  startHS,
  stopHS,
  connect,
  isWifiOn,
} from 'react-native-wifi-connect';

Switch WiFi

wifiSwitch();

Start local only hotspot with no internet capabilities

Returns temp ssid and passphrase separated by #.

startHS().then((ssid_pass) => {
  console.log(ssid_pass); // return ssid and pass in Object {"ssid":"AndroidShare_1234","pass":"121bjdd1823m"}
});

Stop local only hotspot

Returns stopped as a string.

stopHS().then((isStopped) => {
  console.log(isStopped);
});

Connect

connect(ssid: String, pass: String);

Is WiFi On?

isWifiOn().then((b: boolean) => {
  if (b) {
    console.log('Yes');
  } else {
    console.log('No');
  }
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Keywords

react-native

FAQs

Package last updated on 09 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts