react-native-wifi-light-phx
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

react-native-wifi-light-phx

a package interact wifi of PHX

Installation

npm install react-native-wifi-light-phx

Usage

import WifiLight from "react-native-wifi-light-phx";
import {PermissionsAndroid} from 'react-native'
// ...
- With android, before all, must request manifest ACCESS_FINE_LOCATION.
    const granted = await PermissionsAndroid.request(
                PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
                {
                  title: 'Location permission is required for WiFi connections',
                  message:
                    'This app needs location permission as this is required  ' +
                    'to scan for wifi networks.',
                  buttonNegative: 'DENY',
                  buttonPositive: 'ALLOW',
                }
    );
    if(granted == PermissionsAndroid.RESULTS.GRANTED){
        // do something
    }

- Get Current Wifi
- const currentWifi = await WifiLight.getCurrentWifi();
  console.log(currentWifi);

- Only Android
    + Get List Wifi nearby.
    action: WifiLight.getListWifi();
    listener: WifiLight.onDiscoverWifi = (listwifi) => {

    }

Contributing

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

License

MIT

Package Sidebar

Install

npm i react-native-wifi-light-phx

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

2.77 MB

Total Files

101

Last publish

Collaborators

  • sakura1999tb