IOS notification of wifi connection including SSID

后端 未结 2 841
我在风中等你
我在风中等你 2021-02-04 21:38

Newbie IOS programmer looking for a way to get notified when the IPhone connects to a WIFI network.

i.e. Notification for the following transitions: 3G to WIFI WIFI to

相关标签:
2条回答
  • 2021-02-04 22:06

    Using the code u can get the SSID data of the WIFI you are currently connected to.

    CFArrayRef myArray1 = CNCopySupportedInterfaces();
    CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray1, 0));
    NSLog(@"%@",myDict);
    
    0 讨论(0)
  • 2021-02-04 22:11

    For getting notification of network changes, you could drop Apple's Reachability class into your project.

    As for getting SSID's, check out the solutions in the System Configuration framework's CaptiveNetwork API (documentation linked for you).

    0 讨论(0)
提交回复
热议问题