title: iOS: Getting current WiFi SSID is always nil on Testflight
body: <p>Below is the code I use to get my current WiFi SSID and display it in my app.</p>
  <p>I have location permissions set to always, as well as the required Privacy info.plist values. I also have the <code>Access WiFi Information</code> capability added to my project. When I build the app from Xcode to my iPhone (not simulator), it works fine, I can see my WiFi SSID. However, when I distribute the app through Testflight it no longer works, it is returning nothing.</p>
  <pre><code>import SystemConfiguration.CaptiveNetwork
  
  private func getWiFiSsid() -&gt; 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
                      break
                  }
              }
          }
          return ssid
      }
  </code></pre>
  <p>Below is a screenshot of the entitlements that I unpackages from the ipa file, showing that I do have the Access WiFi Information set:
  <a href="https://i.stack.imgur.com/3rG2Z.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3rG2Z.png" alt="WiFi entitlement" /></a></p>