0.3.1 • Published 1 year ago

react-native-wifi-connect v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

0.3.1

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago