Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
react-native-wifi-manager
Advanced tools
Readme
Device Information for react-native
First you need to install react-native-wifi-manager:
npm install react-native-wifi-manager --save
android/setting.gradle
...
include ':WifiManager', ':app'
project(':WifiManager').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-wifi-manager/android')
android/app/build.gradle
...
dependencies {
...
compile project(':WifiManager')
}
On newer versions of React Native (0.18+):
import com.skierkowski.WifiManager.*; // <--- import
public class MainActivity extends ReactActivity {
......
/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new WifiManager(), // <------ add here
new MainReactPackage());
}
}
On older versions of React Native:
import com.skierkowski.WifiManager.*; // <--- import
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
......
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new WifiManager()) // <------ add here
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
mReactRootView.startReactApplication(mReactInstanceManager, "ExampleRN", null);
setContentView(mReactRootView);
}
......
}
var WifiManager = require('react-native-wifi-manager');
loadWifiListData: function() {
WifiManager.list(
(wifiArray) => {
this.setState({
dataSource: this.state.dataSource.cloneWithRows(wifiArray),
});
},
(msg) => {
console.log(msg);
},
);
},
// Attempts to connect to the network specified. This is an async call. Listen to connectionStatus for status
WifiManager.connect(ssid,password);
checkConnectionStatus: function() {
WifiManager.status((status) => {
if (status == 'CONNECTED') {
this.navigateToActivation();
}
});
},
FAQs
Wifi Connection Manager for React Native on Android
The npm package react-native-wifi-manager receives a total of 3 weekly downloads. As such, react-native-wifi-manager popularity was classified as not popular.
We found that react-native-wifi-manager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.