munim-wifi
Comprehensive React Native library for Wi-Fi network scanning and analysis.
Overview
munim-wifi is a comprehensive React Native library for Wi-Fi network scanning and analysis. This library allows your React Native app to scan for nearby Wi-Fi networks, retrieve detailed network information including SSIDs, BSSIDs (MAC addresses), RSSI (signal strength), channels, frequencies, and perform Wi-Fi fingerprinting for location-based services. Fully compatible with Expo! Works seamlessly with both Expo managed and bare workflows. Built with React Native's Nitro modules architecture for high performance and reliability.
Installation
npx expo install munim-wifi react-native-nitro-modulesFor bare React Native without Expo: npm install munim-wifi react-native-nitro-modules
Usage
import { scanNetworks, requestWifiPermission, isWifiEnabled } from 'munim-wifi'
// Check if Wi-Fi is enabled
const wifiEnabled = await isWifiEnabled()
// Request permissions (required for scanning)
const hasPermission = await requestWifiPermission()
// Scan for networks
const networks = await scanNetworks()
networks.forEach(network => {
console.log(`SSID: ${network.ssid}, RSSI: ${network.rssi} dBm`)
})Requirements
Expo SDK 50+, React Native v0.78.0+
Platform notes
iOS
Limited capabilities: Only SSID and BSSID available. RSSI, channel, and frequency are NOT available for scanned networks. Requires location permission. CoreWLAN framework is macOS only.
Android
Full network scanning with SSID, BSSID, RSSI, channel, and frequency. Requires location permission (Android 6.0+). Scanning throttled: 4 scans every 2 minutes for foreground apps.
API
Methods
scanNetworks()
Performs a one-time scan for nearby Wi-Fi networks. Returns an array of network objects with SSID, BSSID, and on Android: RSSI, channel, frequency.
Returns: Promise<WifiNetwork[]>
Example
const networks = await scanNetworks();
networks.forEach(n => console.log(n.ssid, n.rssi));requestWifiPermission()
Requests the permissions required for Wi-Fi scanning (e.g. location on Android). Call before scanning.
Returns: Promise<boolean>
Example
const granted = await requestWifiPermission();isWifiEnabled()
Returns whether Wi-Fi is currently enabled on the device.
Returns: Promise<boolean>
getWifiFingerprint()
Creates a Wi-Fi fingerprint (list of visible networks with identifiers and signal strength) for location-based services. Android only for full data.
Returns: Promise<WifiFingerprint>
startScan(callback?)
Starts continuous Wi-Fi scanning. The callback is invoked when new scan results are available. Android only; subject to platform throttling.
Returns: Promise<() => void>
stopScan()
Stops continuous scanning and removes the listener.
Returns: Promise<void>
connectToNetwork(ssid, password?)
Attempts to connect to a Wi-Fi network by SSID. Password required for secured networks. Platform capabilities vary.
Returns: Promise<void>
getCurrentNetwork()
Returns information about the currently connected Wi-Fi network (SSID, BSSID, etc.).
Returns: Promise<WifiNetwork | null>
Types
WifiNetwork
| Property | Type | Description |
|---|---|---|
| ssid | string | Network name (SSID). |
| bssid | string | Access point MAC address (BSSID). |
| rssi? | number | Signal strength in dBm (Android). |
| channel? | number | Channel number (Android). |
| frequency? | number | Frequency in MHz (Android). |
Features
- •Network Scanning - Scan for nearby Wi-Fi networks with detailed information
- •Signal Strength - Get RSSI (signal strength) values for all networks (Android only)
- •Network Details - Retrieve SSIDs, BSSIDs (MAC addresses), channels, and frequencies (Android only)
- •Wi-Fi Fingerprinting - Create comprehensive Wi-Fi fingerprints for location services
- •Continuous Scanning - Support for continuous scanning with event-based updates (Android only)
- •Connect to Networks - Programmatically connect to Wi-Fi networks
- •Current Network Info - Get information about currently connected network
- •IP Address - Retrieve IP address information for current connection
- •Cross-platform - Works on both iOS and Android (with platform-specific limitations)
- •TypeScript Support - Full TypeScript definitions included
- •Expo Compatible - Works seamlessly with Expo managed and bare workflows
For the latest API reference, usage examples, and troubleshooting, visit the GitHub repository and npm package page.