简体   繁体   English

在iOS 11“无法加入网络”中连接到wifi网络

[英]Connecting to to wifi network in iOS 11 “Unable to join the network”

I'm trying to connect to wifi network inside app. 我正在尝试连接到应用程序内的wifi网络。 using the code below: 使用以下代码:

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")
    }        
}

But when I'm unable to join the network I get an Alert saying : "Unable to join the network testNetwork" 但是,当我无法加入网络时,我会收到一条警告 :“无法加入网络testNetwork”

My question is there any way to not display the alert if i'm unable to connect? 我的问题是,如果我无法连接,有什么方法显示警报?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM