Starting with iOS 14, the SSID and BSSID of the currently connected Wi-Fi network can be obtained using the fetchCurrent(completionHandler:) method of the NEHotspotNetwork class. Note that the use of fetchCurrent(completionHandler:) does
not require the NEHotspotHelper entitlement.
This method returns SSID and BSSID of the current Wi-Fi network when the requesting application meets one of following 4 requirements:
application is using CoreLocation API and has user's authorization to access precise location.
application has used NEHotspotConfiguration API to configure the current Wi-Fi network.
application has active VPN configurations installed.
application has active NEDNSSettingsManager configuration installed.
An application will receive nil if it fails to meet any of the above 4 requirements.
An application will receive nil if does not have the "com.apple.developer.networking.wifi-info" capability.