我有关于IOS中私有API的问题。是否有某些API可以管理WiFi连接?例如,我正在使用Apple80211.framework来扫描WiFi网络,但它无法用于连接。
我的应用程序不是为App Store准备的。
Swift:
var configuration = NEHotspotConfiguration.init(ssid: "wifi name", passphrase: "wifi password", isWEP: false)
configuration.joinOnce = true
NEHotspotConfigurationManager.shared.apply(configuration) { (error) in
if error != nil {
//an error occurred
print(error?.localizedDescription)
}
else {
//success
}
}
import NetworkExtension
。去年我遇到了这个问题,经过一番探索,我找到了一个有用的示例,名为SOLStumbler。要使此应用程序工作,您的设备必须越狱。我修改了 SOLStumbler 并在 github 上发布了一个示例应用程序。它使用 IPConfiguration bundle 访问 Apple80211 框架,从而允许您关联到网络。自定义的构建说明在 readme 中。
NEHotspotConfiguration
。Hotspot
功能。以下是一个快速工作示例:NEHotspotConfiguration *configuration = [[NEHotspotConfiguration
alloc] initWithSSID:@“SSID”];
configuration.joinOnce = YES;
[[NEHotspotConfigurationManager sharedManager] applyConfiguration:configuration completionHandler:nil];