react-native-network-info icon indicating copy to clipboard operation
react-native-network-info copied to clipboard

Wifi List

Open Chatharaju opened this issue 7 years ago • 3 comments

Hi there, great work. Any chance this can be extended to get all wifi list and connect to specific wifi

Thanks,

Vinay.

Chatharaju avatar Feb 01 '18 19:02 Chatharaju

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);
}

vjfuenzalida avatar May 25 '18 04:05 vjfuenzalida

That's actually a feature I am looking for. @vjfuenzalida any success implementing it?

pedrosimao avatar Aug 01 '18 19:08 pedrosimao

iOS and Android don't allow third-party apps to access this information due to security reasons.

Rapsssito avatar Sep 21 '19 09:09 Rapsssito