能否获取系统wifi列表信息

不能,只能获取用户当前连接的wifi信息

https://developer.apple.com/forums/thread/112177

https://developer.apple.com/documentation/systemconfiguration/1614126-cncopycurrentnetworkinfo

能否自动扫描周边特定wifi名并通过密码连接

iOS11+ 系统才可以。

通过代码设置wifi名字和前缀(密码可根据wifi是否有密码选不同方法)连接, 测试发现连接所需时间一般在5s以上,并且在wifi远离等信号较弱时,可能会失败(unknown/internal error/无法加入网络)

代码可以触发检测一次,如果检测到同名wifi并且密码一致,系统会自动弹窗供用户选择是否加入。

是否自动循环检测?

不会,但是可以根据回调结果,自定义定时器重新检测。

连接后有效期

可设置是否单次有效(下次进入app会重新检测)和有效天数。

单次有效相关:

When joinOnce is set to true, the hotspot remains configured and connected only as long as the app that configured it is running in the foreground. The hotspot is disconnected and its configuration is removed when any of the following events occurs:

The app stays in the background for more than 15 seconds.

The device sleeps.

The app crashes, quits, or is uninstalled.

The app connects the device to a different Wi-Fi network.

The user connects the device to a different Wi-Fi network.

To disconnect the device from a hotspot configured with joinOnce set to true, call removeConfiguration(forSSID:).

手机的 wifi 连接中断后(比如wifi设备关闭/远离),当wifi设备打开/靠近,app再次尝试连接时,是否会再次弹窗请求用户允许加入

会再次弹窗请求,每次重连 wifi 都必须执行相关代码,且手机系统会自动再次弹窗。此特性与是否开启“单次有效”参数无关。

代码示例

最新文章

  1. 深入JVM-锁与并发
  2. Codeforces Gym 101138 D. Strange Queries
  3. 利用反射和ResultSetMetaData实现DBUtils的基本功能
  4. South - 在 Django 中 Migrate Database
  5. Math类和Random类(数学公式相关类)
  6. 六、Android学习笔记_JNI_c调用java代码
  7. 用C语言实现有限状态自动机FSM
  8. arm+linux 裸机环境搭建之安装工具篇(eclipse)
  9. 关于split与StringTokenizer的理解
  10. shell 命名管道,进程间通信
  11. 快速找到Office应用程序安装路径
  12. Linq SelectMany 交叉连接
  13. java开发----自定义对象,重写equals方法
  14. 解决非root用户使用docker的办法
  15. Djangon的坑
  16. runAllManagedModulesForAllRequests
  17. Linux/Unix 中 wheel 组的来源
  18. 【leetcode-69】 x 的平方根
  19. Win10系列:C#应用控件基础9
  20. Ubuntu下安装程序的三种方法(转)

热门文章

  1. Powershell免杀从入门到实践
  2. 性能测试工具JMeter 基础(七)—— 测试元件: 逻辑控制器之if逻辑控制器
  3. uni-app中websocket的使用 断开重连、心跳机制
  4. eclipse的C/C++开发搭建
  5. java版gRPC实战之三:服务端流
  6. activemq启动错误UnsupportedClassVers rg/apache/activemq/console/Main:Unsupported major.minor version52.0
  7. freeswitch刷新网关方法
  8. python循环以及控制语句
  9. 学习PHP中国际化地数字格式处理
  10. PHP中的PDO操作学习(四)查询结构集