CNCopyCurrentNetworkInfo returns SSID on iPhone 12 Pro (iOS 18.6.2) but returns nil on iPhone 13 (iOS 26.4.2)

I need official technical support regarding the CNCopyCurrentNetworkInfo API. My app can successfully get the Wi-Fi SSID on iPhone 12 Pro (iOS 18.6.2). But on iPhone 13 (iOS 26.4.2), the same code always returns nil and cannot get the Wi-Fi name. I have already enabled: Access WiFi Information capability Location Permission (When in Use) The app is in foreground Here is my code:

private func getCurrentWiFiName() -> String? {
    if let interfaces = CNCopySupportedInterfaces() as? [String] {
        print("Detected \(interfaces.count) network interfaces")
        for (index, interface) in interfaces.enumerated() {
            print("Interface \(index): \(interface)")
            if let info = CNCopyCurrentNetworkInfo(interface as CFString) as? [String: Any] {
                print("Interface \(index) info: \(info)")
                if let ssid = info[kCNNetworkInfoKeySSID as String] as? String {
                    print("Successfully got SSID: \(ssid)")
                    return ssid
                }
            } else {
                print("Failed to get info for interface \(index)")
            }
        }
    } else {
        print("Failed to get network interfaces")
    }
    return nil
}

My questions: Why does this API work on iOS 18.6.2 but not on iOS 26.4.2? Has Apple restricted or disabled CNCopyCurrentNetworkInfo in iOS 26+? What is the official supported way for normal App Store apps to get Wi-Fi SSID on iOS 26? Thank you for your help.

CNCopyCurrentNetworkInfo returns SSID on iPhone 12 Pro (iOS 18.6.2) but returns nil on iPhone 13 (iOS 26.4.2)
 
 
Q