ios - 如何区分不同配置的网络?
问题描述
我有一个配置 Passpoint 和 WPA Enterprise 网络的应用程序。
我正在使用NEHotspotConfigurationManager.getConfiguredSSIDs()
查看我的应用配置了哪些网络。它确实返回正确的数据,即域或 SSID;我两个都懂。
但我的问题是我的 passpoint 域和 WPA Enterprise SSID 是相同的值,例如example.com
。
有没有办法可以区分检查这example.com
是 passpoint 还是 WPA Enterprise?
甚至获取实际的配置数据,例如域、EAP 类型、用户名等?我可以使用那里的一些数据来区分两者。
为什么?我需要能够检查是否安装了任一配置,但因为它们都是同名的;使用下面的函数证明它很麻烦。
我可以有不同的名字吗?不幸的是,没有。
func configCheck(searchString: String, completionHandler: @escaping CompletionHandler) {
var flag = false;
let manager = NEHotspotConfigurationManager.shared;
manager.getConfiguredSSIDs {
(ssidsArray) in
print("COUNT: ", ssidsArray.count)
for ssid in ssidsArray {
print("SSID: ", ssid)
}
if ssidsArray.contains(searchString) {
flag = true
print("true")
}
else {
flag = false
print("false")
}
completionHandler(flag)
}
}
以上将打印;
计数:2
SSID: example.com (Is this passpoint or enterprise?)
SSID: example.com (Is this passpoint or enterprise?)
解决方案
推荐阅读
- android-emulator - 错误@wdio/cli:utils:“onPrepare”挂钩中的服务失败错误:Appium 在超时之前退出(退出代码:1)-Appium 在 VSCode 中使用模拟器
- acumatica - 在销售报价屏幕 CR304500 中创建操作时出错
- firebase - Firebase Flutter错误尝试在空对象引用上调用虚拟方法'java.lang.Class java.lang.Object.getClass()'
- php - 127.0.0.1 重定向你太多次 - Laravel 8.x
- jekyll - 使用 jekyll 更改个人站点配置
- javascript - 如何升级 AngularJs 应用程序
- cherrypy - 无法通过 external_auth SaltStack 通过位置参数限制 API 访问
- java - Smali - 无法调用实例构造函数
- python - 创建签名和问候 SMTP 电子邮件设置 Django
- magento - 从 Magento 2.3.3 升级到 Magento 2.4.2 在 qbo/module-paypalplusmx 上出现错误