Overview
The react-native-wifi-reborn is a project that continues the development of the no longer maintained react-native-wifi project. It provides functionality to connect to Wi-Fi networks on both iOS and Android platforms. The installation process involves setting up permissions and linking the library, while also providing support for different React Native versions and platforms.
Features
- Autolinking Support: Library is correctly autolinked on React Native 60+.
- Cross-Platform Compatibility: Methods work on both Android and iOS.
- Connect to Protected Wi-Fi: Allows connecting to protected Wi-Fi networks with specified SSID, password, and encryption types.
- Customization with Props: Provides props for extra customization, like the fineLocationPermission option.
Installation
iOS
- Add RNWifi.xcodeproj from node_modules/react-native-wifi-reborn to your Xcode project.
- Add libRNWifi.a to your project’s Build Phases ➜ Link Binary With Libraries.
- Run your project.
Android
- In MainActivity.java, import
com.reactlibrary.rnwifi.RNWifiPackage, and add it to the list returned by thegetPackages()method. - Modify android/settings.gradle and android/app/build.gradle following the provided instructions.
Props and Prebuild Plugin
- Add the config plugin to app.json or app.config.js after installing the npm package.
- Rebuild the app to incorporate any changes in props or plugins.
Summary
The react-native-wifi-reborn project is a continuation of the react-native-wifi library, providing methods to connect to Wi-Fi networks on both iOS and Android platforms. The installation process involves setting up permissions and linking the library for both platforms. Additionally, the library offers autolinking support, cross-platform compatibility, customization through props, and the ability to connect to protected Wi-Fi networks with specified credentials.