I could get the ssid of the connected wifi to my iPhone. After Installing Xcode 10 and Updating Visual Studio for Mac and Visual Studio 2017, it returns me an empty ssid.
To use this function in iOS 12 and later, enable the Access WiFi Information capability for your app .
So you have to check Access WiFi Infomation in appid.