myApp has "Access WiFi Information Entitlement" as:
<key>com.apple.developer.networking.wifi-info</key>
<true/>
CNCopyCurrentNetworkInfo() works on iOS12.3.1.
But it returns nil on iOS13 with same network environment as iOS12.3.1.
Check out WWDC 19 session 713, Advances in Networking, Part 2 (maybe 75% of the way through the presentation). CNCopyCurrentNetworkInfo is now only available to your app in three cases:
- Apps with permission to access location
- Your app is the currently enabled VPN app
- Your app configured the WiFi network the device is currently using via NEHotspotConfiguration
If you don't meet at least one of these conditions CNCopyCurrentNetworkInfo will always return nil in iOS 13.
Having said all of that, I have ensured now that my app does have "Always Allow" location but I am still receiving nil from CNCopyCurrentNetworkInfo. Will report back if I figure it out.
EDIT: disregard that last statement, forgot I had commented out CNCopyCurrentNetworkInfo while attempting to implement the new WiFi framework 😁