- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的应用程序使用 NEHotspotConfigurationManager
使用 Wi-Fi 将自身连接到特定设备。该设备充当 WPA2 接入点。在较旧的 iOS 版本(iOS 12 及更低版本)中,一切正常,但在 iPadOS/iOS 13 中,设备每次都会在一段时间后断开连接。如何在不存储的情况下保持连接 NEHotspotConfiguration
永久?
我怀疑它与一个新功能有关 - 多个 Windows(我的应用程序不支持)。原因是在我的NEHotspotConfiguration
我设置joinOnce
标记为 true
(因为设备的网络不应该在应用程序之外使用)。 Apple's documentation状态:
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.
joinOnce
至
false
使应用程序保持连接,但这不是一个可接受的解决方案,因为我的设备不提供 Internet 连接,并且不得在应用程序之外使用它。
let hotspotConfiguration = NEHotspotConfiguration(ssid: self.ssid, passphrase: self.passphrase, isWEP: false)
hotspotConfiguration.joinOnce = true
NEHotspotConfigurationManager.shared.apply(hotspotConfiguration) { error in
// connection is successfully applied
// and about 15 seconds later it is lost.
}
我希望在
joinOnce
时保持连接。标志设置为
true
.
最佳答案
Apple 似乎已在 iOS 13.4 beta 2 中修复了该问题,它现在可以与 joinOnce = true
一起使用如记录。 Related discussion on Apple's forum
关于ios - iPadOS:通过 NEHotspotConfiguration 连接的网络在一段时间后断开连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57552952/
我正在尝试使用以下代码在 iOS 中进行自动连接 if([Utils isEmpty:password]){ configuration = [[NEHotspotConfiguration al
我的应用程序使用 NEHotspotConfigurationManager使用 Wi-Fi 将自身连接到特定设备。该设备充当 WPA2 接入点。在较旧的 iOS 版本(iOS 12 及更低版本)中,
当我使用NEHotspotConfigurationManager加入具有64个十六进制数字的wpa2网络时,我收到错误: NEHotspotConfiguration invalid WPA/WPA
我在为 React Native 应用程序开发的 native 模块中使用 NEHotspotConfigurationManager 来连接到公开开放 WiFi 热点的设备。在旧版 iOS 版本(i
我目前正在运行 Xcode 11.0 和 iOS 13.1(测试版)。我正在试验 iOS 13 中新添加的功能,即能够连接到只有前缀已知的 Wifi 热点: Apple Docs 这非常适合 head
我是一名优秀的程序员,十分优秀!