You'd need to talk to the device(s), first, and even then you risk assumptions - For example, 802.11ac devices can't connect to a Wi-Fi router in 802.11n-only mode. In other words, I don't think there is a lever you can pull via code to know for certain. Just because a device is capable, doesn't mean a specific configuration is in use/available. Same as if a network name includes 5.0 in it's name...doesn't mean you can count on that being true.
Perhaps if you explained your end goal for wanting this ability, someone could offer suggestions.
Thanks for your reply. The idea is we have an accessory that needs to connect to the user's home wifi network. I want to make this as easy as possible for the user. So if their phone is already connected to a wifi network I can guess that they also want to connect the accessory to this same wifi network, with the option of letting them select a different wifi network if necessary. However, the accessory can only connect to 2.4ghz networks so I would like to do this additional check before suggesting this network to the user.
Thanks for the additional info. Sounds like a bonus feature, then. And all things being even, unless a 5.0 network is named as such, it might be too much to ask otherwise...don't complicate the process
If anyone has another way to check if the current wifi network is 2.4g or 5.0g, I am still looking for a solution. Although I can check the name of the wifi network for the number "5" this is not 100% reliable so I would like to have some alternatives. Thanks!
I am using
CNCopyCurrentNetworkInfoto get the SSID of the current wifi connection.
Be aware that
CNCopyCurrentNetworkInfohas changed in iOS 13 beta. WWDC 2019 Session 708 Designing for Privacy has some general background on this change and the docs have been updated with the details.
I am wondering if there is a way to tell whether this WiFi is 2.4 or 5.0Ghz?
No. iOS has always placed strict limits on what apps can do with Wi-Fi, and there’s never been a supported API for getting low-level Wi-Fi information like this.
The idea is we have an accessory that needs to connect to the user's home wifi network.
My recommendation here is that you support Wireless Accessory Configuration (WAC) in your accessory. This post has links to more info on that technology.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Thank you, I appreciate your help.