Skip to content
Fix CNCopyCurrentNetworkInfo() does NOT work on iOS13
Branch: master
Clone or download
Latest commit 9a16782 Jun 13, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
Check-WiFI.xcodeproj Add reference Jun 12, 2019
Check-WiFI Print SSID Jun 13, 2019
screenshots Add screenshot Jun 12, 2019
.gitignore Initial commit Jun 12, 2019
LICENSE Initial commit Jun 12, 2019 Print SSID Jun 13, 2019


Fix CNCopyCurrentNetworkInfo() does NOT work on iOS13

Get Wi-Fi SSID on iOS 12 or earlier


import Foundation
import SystemConfiguration.CaptiveNetwork

func getSSID() -> String? {
    var ssid: String?
    if let interfaces = CNCopySupportedInterfaces() as NSArray? {
        for interface in interfaces {
            if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? {
                ssid = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String
    return ssid

To use CNCopyCurrentNetworkInfo() in iOS 12 and later, enable the Access WiFi Information capability in Xcode. For more information, see Access WiFi Information Entitlement.

CNCopyCurrentNetworkInfo() returns nil on iOS 13

Watch WWDC19 Session 713: Advances in Networking, Part 2.

Now you all know the important privacy to Apple. And one of the things we realized. Is that... Accessing Wi-Fi information can be used to infer location.

So starting now, to access that Wi-Fi information. You'll need the same kind of privileges that you'll need to get other location information.


Requires Capability: Access Wi-Fi Information

Must also meet at least one of criteria below

  • Apps with permission to access location
  • Currently enabled VPN app
  • NEHotspotConfiguration (only Wi-Fi networks that the app configured)

Otherwise, returns nil

Get Wi-Fi SSID on iOS 13 or later

Import Core Location framework

import CoreLocation

Function to update UI

func updateWiFi() {
    print("SSID: \(currentNetworkInfos?.first?.ssid)")
    ssidLabel.text = getSSID()

Ask location permission

if #available(iOS 13.0, *) {
    let status = CLLocationManager.authorizationStatus()
    if status == .authorizedWhenInUse {
    } else {
        locationManager.delegate = self
} else {

Implement CLLocationManagerDelegate

class ViewController: UIViewController, CLLocationManagerDelegate {
    func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
        if status == .authorizedWhenInUse {

Update your app

If your app uses CNCopyCurrentNetworkInfo() and needs to solve the issue. Solve it now. There's no need to wait for Xcode 11 GM. The solution above is Xcode 10 compatible.

You can’t perform that action at this time.