CNCopyCurrentNetworkInfo with iOS 13 : <p>Apple changed some things regarding WiFi with iOS 13. If you want to use CNCopyCurrentNetworkInfo your app needs to have one of the following</p>

<ul>
<li>Apps with permission to access location</li>
<li>Your app is the currently enabled VPN app</li>
<li>Your app configured the WiFi network the device is currently using via NEHotspotConfiguration</li>
</ul>

<p>Source: WWDC 19 session 713</p>

<p>I am configuring a network using NEHotspotConfiguration but I can not get the current SSID anymore after doing so. </p>

<p>The following code worked fine with iOS 12:</p>

<pre><code>/// retrieve the current SSID from a connected Wifi network  
private func retrieveCurrentSSID() -&gt; String? {  
    let interfaces = CNCopySupportedInterfaces() as? [String]  
    let interface = interfaces?  
        .compactMap { [weak self] in self?.retrieveInterfaceInfo(from: $0) }  
        .first  

    return interface  
}  

/// Retrieve information about a specific network interface  
private func retrieveInterfaceInfo(from interface: String) -&gt; String? {  
    guard let interfaceInfo = CNCopyCurrentNetworkInfo(interface as CFString) as? [String: AnyObject],  
        let ssid = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String  
        else {  
            return nil  
    }  
    return ssid  
} 
</code></pre>

<p>With iOS 13 <code>CNCopyCurrentNetworkInfo</code> always returns nil.</p>

<p>My app has the Access WiFi Information Capability set.</p>

<p>Thanks for your help!</p>
