OGeek|极客世界-中国程序员成长平台

标题: ios - 在 iOS 11 中连接到 wifi 网络 "Unable to join the network" [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 19:35
标题: ios - 在 iOS 11 中连接到 wifi 网络 "Unable to join the network"

我正在尝试连接到应用程序内的 wifi 网络。使用下面的代码:

let hotspotConfig = NEHotspotConfiguration(ssid: "testNetwork")
hotspotConfig.joinOnce = true
NEHotspotConfigurationManager.shared.apply(hotspotConfig) { (configurationError) in
    if configurationError != nil {
      print("error")
      print(configurationError!.localizedDescription)
    } else {
      print("success")
    }        
}

但当我无法加入网络时,我会收到 Alert 提示: "无法加入网络testNetwork"

我的问题是,如果我无法连接,有什么方法可以显示警报?



Best Answer-推荐答案


我很确定您无法拦截和隐藏该消息,因为它是由操作系统处理的(与加入网络弹出窗口相同)。

关于ios - 在 iOS 11 中连接到 wifi 网络 "Unable to join the network",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48197167/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4