![](/img/trans.png)
[英]Using iOS 11 NEHotspotConfiguration capability on a Simulated Device and not just a physical device
[英]NEHotspotConfiguration is not working in ios 11
我嘗試使用 NEHotspotConfiguration 用 ssid 和密碼連接特定的 wifi,它有內部服務器錯誤。
如果您有關於如何在 ios 上連接到 wifi AP 的答案,請幫助我。
請嘗試以下操作:
這是我的代碼,它可能對你有用:
-(IBAction) joinWiFi_ButtonPressed: (id) sender {
if (@available (iOS 11.0, *)) {
NEHotspotConfiguration * configuration = [[NEHotspotConfiguration alloc] initWithSSID: @ "Your SSID" passphrase: @ "Password" isWEP: NO];
configation.joinOnce = YES;
[[NEHotspotConfigurationManager sharedManager] applyConfiguration: configuration completionHandler: ^ (NSError * _Nullable error) {
if (error == nil) {
NSLog (@ "Is Connected!!");
} else {
NSLog (@ "Error is:% @", error);
}}];
} else {
NSLog (@ "This Device Not iOS 11 +");
}
}
你能貼出你的錯誤日志嗎? 它可以幫助我更好地理解您的問題並完善我的答案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.