react-native-ios-wifi
Experimental implementation of automatically connecting to protected WiFi from a react native app. This version supports pod install and is compatible with react-native 0.60 and above
Getting started
$ npm install react-native-ios-wifi --save
Mostly automatic installation
$ react-native link react-native-ios-wifi
$ cd ios
$ pod install
Manual installation
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-ios-wifi
and addIosWifi.xcodeproj
- In XCode, in the project navigator, select your project. Add
libIosWifi.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Usage
; // Call this method to automatically connect to WiFi with passwordtry await WifiManager;catch error console; // Call this method to automatically connect to WiFi without passwordtry await WifiManager;catch error console; // Call this method to automatically disconnect from a given WiFitry await WifiManager;catch error console; // Call this method to fetch current WiFi detailstry const wifiDetails = await WifiManager;catch error console;