Can the iPhone SDK obtain the Wi-Fi SSID currently connected to?

前端 未结 3 1431
情歌与酒
情歌与酒 2020-11-28 07:38

In the iPhone SDK I don\'t see the same SCDynamicStore used on Mac OS X to get the SSID name that your wireless network is currently connected to isn\'t availab

3条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 08:17

    Try this code,

    #import 
    
    CFArrayRef myArray = CNCopySupportedInterfaces();
    CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
    NSDictionary *ssidList = (__bridge NSDictionary*)myDict;
    NSString *SSID = [ssidList valueForKey:@"SSID"];
    

提交回复
热议问题