gpt4 book ai didi

ios - 无法获取 Wifi ios 12 的 SSID

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:20:29 26 4
gpt4 key购买 nike

我无法获取 wifi SSID(wifi 的唯一 key )。我看到了很多答案,但对我没有任何用处。

我发现最常见的答案是启用 ,In Xcode, under

Targets -> Capabilities -> Access WiFi Information -> Enable it to ON

我的 Xcode 版本是 10.1 ,那里没有Access WiFi Information 的选项。所以我打开了Wireless Accessory Configuration

我的代码是

extension UIDevice {

public var SSID: String?{
get {
guard let interfaces = CNCopySupportedInterfaces() as? [String] else { return nil }
let key = kCNNetworkInfoKeySSID as String
for interface in interfaces {
guard let interfaceInfo = CNCopyCurrentNetworkInfo(interface as CFString) as NSDictionary? else { continue }
return interfaceInfo[key] as? String
}
return nil
}
}
}

我的 swift 版本是 4.2 ,构建目标版本是 12.1 。我是 IOS 开发的新手。请让我知道,我做错了什么。我怎样才能把它改正。

最佳答案

My Xcode version is 10.1 ,There is no option there for Access WiFi Information

那么您的 Xcode 项目、Xcode 或您的开发者资料有问题...

WiFi

确保您的项目使用最新的 Xcode 配置更新到最新(通常,我只是构建项目并检查警告)

I dont have app-store account ,I just created new apple ID

Choosing a Membership/Benefits and resources 下所列, “Advanced App Capabilities”不适用于“Sign in with Apple ID”(或免费开发者账户),这或许可以解释为什么“Access WiFi Information”对你不可用

关于ios - 无法获取 Wifi ios 12 的 SSID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53967156/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com