IOS通知wifi连接包括SSID [英] IOS notification of wifi connection including SSID

查看:122
本文介绍了IOS通知wifi连接包括SSID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新手IOS程序员在IPhone连接到WIFI网络时寻找通知方式。

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

即。
以下转换的通知:
3G到WIFI
WIFI到3G
WIFI到另一个WIFI

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

它应该是能告诉我连接到哪个SSID ...

It should be able to tell which SSID I am connected to ...

这花了大约20分钟来弄清楚Android,在IOS上找不到这个功能的起点

This took about 20 minutes to figure out on Android, can't find a starting point for this function on IOS

谢谢

推荐答案

使用代码你可以得到SSID数据您目前所连接的WIFI。

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

这篇关于IOS通知wifi连接包括SSID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆