Hi! I'm working on an extension of UIDevice to give people access to bssid, ssid and signal strength by simple doing
let SSID = UIDevice.current.ssid
The extension is working as expected but it needs special entitlements to work. You can request those at https://developer.apple.com//contact/request/network-extension/ .
What should I do now? Should the library itself include entitlements? (But can it?)
Should the library include just the extension, giving to the users the job to add entitlements to their apps?
Should the library not at all include such an extension, since it requires special entitlements ?
[x ] I've read, understood, and done my best to follow the Contributing guidelines before opening this issue.
Update: Apple responded me that they will not give me entitlements for a library.
So two options remain:
@marcocapano You have to request special entitlements for network extension for obtaining list of visible WiFi ssids, for gathering only current active I use no extra capabilities.
import SystemConfiguration.CaptiveNetwork
extension UIDevice {
public var SSID: String? {
guard let interfaceNames = CNCopySupportedInterfaces() as? [String] else {
return nil
}
return interfaceNames.compactMap { name in
guard let info = CNCopyCurrentNetworkInfo(name as CFString) as? [String:AnyObject] else {
return nil
}
guard let ssid = info[kCNNetworkInfoKeySSID as String] as? String else {
return nil
}
return ssid
}.first
}
}
So in the same way you can get BSSID and some other current wifi connection's properties
Thanks, I'll give it a look. I'm planning to make a pull request by this evening
Haven't read this entire thread but SSID -> ssid if anyone adds an extension from the discussion 馃槢
Thank you for your extension @marcocapano
I think we should not include extensions that require specific entitlements