5

I want to get all nearby networks(and/or the network the device is connected to). I am using Xcode 13 IOS14 and this code:

NEHotspotNetwork.fetchCurrent(completionHandler: { (network) in  
    if let unwrappedNetwork = network {  
        let networkSSID = unwrappedNetwork.ssid  
        print("Network: %{public}@ ", networkSSID )  
    } else {   
        print("No available network")               
    }           
})

info.plist:

enter image description here

Capabilities:

enter image description here

I tried this code and got this line: NEHotspotNetwork nehelper sent invalid result code [1] for Wi-Fi information request No available network

Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220

0 Answers0