react-native-network-info
react-native-network-info copied to clipboard
Wifi List
Hi there, great work. Any chance this can be extended to get all wifi list and connect to specific wifi
Thanks,
Vinay.
I haven't tried yet, but maybe modifying ios/RNNetworkInfo.m could do the job:
RCT_EXPORT_METHOD(getSSIDList:(RCTResponseSenderBlock)callback)
{
NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces());
NSDictionary *SSIDInfo;
NSArray *SSIDList = @["error"];
for (NSString *interfaceName in interfaceNames) {
SSIDInfo = CFBridgingRelease(CNCopyCurrentNetworkInfo((__bridge CFStringRef)interfaceName));
if (SSIDInfo.count > 0) {
SSIDList = [SSIDInfo allValues];
break;
}
}
callback(@SSIDList);
}
That's actually a feature I am looking for. @vjfuenzalida any success implementing it?
iOS and Android don't allow third-party apps to access this information due to security reasons.