Hi,
Is there any API exposed to fetch network security type like "WPA", "WPA2", "WES" or None for iOS device?
Hi,
Is there any API exposed to fetch network security type like "WPA", "WPA2", "WES" or None for iOS device?
Yes. You can get the current network using the NEHotspotNetwork.fetchCurrent(completionHandler:) method and then read the securityType property.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Hi Eskimo,
Thanks for your reply and I tried NEHotspotNetwork.fetchCurrent(completionHandler:) method API and then read securityType property and the good thing is that it does work. Many thanks for suggesting this.
I have 2 more qs based on this.
is there a way to get security type in lower versions of ios (< 15.0)??
Do I need any permissions to use this API?
Any app can call this API.
See the doc comments in <NetworkExtension/NEHotspotNetwork.h> for info about the permission model.
NEHotspotNetwork.fetchCurrent(completionHandler:)method API is available in iOS 14.0+ andsecurityTypeproperty is available in iOS 15.0+
Yep. It was a much-requested enhancement.
is there a way to get security type in lower versions of iOS (< 15.0)?
No.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Thank you so much!