菜鸟教程小白 发表于 2022-12-11 19:35:30

ios - 在 iOS 11 中连接到 wifi 网络 "Unable to join the network"


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

<pre><code>let hotspotConfig = NEHotspotConfiguration(ssid: &#34;testNetwork&#34;)
hotspotConfig.joinOnce = true
NEHotspotConfigurationManager.shared.apply(hotspotConfig) { (configurationError) in
    if configurationError != nil {
      print(&#34;error&#34;)
      print(configurationError!.localizedDescription)
    } else {
      print(&#34;success&#34;)
    }      
}
</code></pre>

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

<p>我的问题是,如果我无法连接,有什么方法可以<strong>不</strong>显示警报?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我很确定您无法拦截和隐藏该消息,因为它是由操作系统处理的(与加入网络弹出窗口相同)。 </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 在 iOS 11 中连接到 wifi 网络&#34;Unable to join the network&#34;,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/48197167/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/48197167/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 在 iOS 11 中连接到 wifi 网络 &#34;Unable to join the network&#34;