Is there a way to get the ssid for the currently-active WiFi network on iOS?

Hello,

The product I’m working on uses a WiFi-connected bluetooth peripheral. There is a scenario I’ve been asked to implement that involves being able to detect WiFi connectivity given the peripheral’s notion of WiFi ssid. Snooping around on the internet, I’ve run across several examples getting the iOS current WiFi ssid that involve using CNCopySupportedInterfaces and CNCopyCurrentNetworkInfo, followed by interfaceInfo[kCNNetworkInfoKeySSID as String] to get the ssid. Why I’ve found is that the only information available on iOS 16 is the interface name, like “en0”, and not the ssid, unless the WiFi connection had been configured as a hotspot.

Am I going about this correctly?

Thanks