0

I am trying to find all the nearby hotspots using the following code:

for(NEHotspotNetwork *hotspotNetwork in [NEHotspotHelper supportedNetworkInterfaces]) {
            NSString *ssid = hotspotNetwork.SSID;
            NSLog(ssid);
            NSString *bssid = hotspotNetwork.BSSID;
            BOOL secure = hotspotNetwork.secure;
            BOOL autoJoined = hotspotNetwork.autoJoined;
            double signalStrength = hotspotNetwork.signalStrength;
        }

I ran this code in the simulator after the user clicks a button. However, [NEHotspotHelper supportedNetworkInterfaces] returns nil. I don't understand why.

Keselme
  • 3,779
  • 7
  • 36
  • 68
  • It's my first experience with IOS development, so I'll try to run it on an actual device to see if it helps – Keselme Aug 05 '18 at 11:19
  • I tried running it on actual device and still got nil – Keselme Aug 05 '18 at 13:23
  • Do you have the necessary entitlements? You can't participate in NEHotspotHelper without special application to Apple. https://stackoverflow.com/questions/46823754/how-can-i-get-available-wifi-list-with-nehotspothelper-ios-objective-c – matt Aug 05 '18 at 14:14

1 Answers1

0

Check NEHotspotHelper class documentation. You will need com.apple.developer.networking.HotspotHelper entitlement to work with NEHotspotHelper class. You have to contact Apple to request this entitlement.

Ravi Prakash
  • 1,078
  • 1
  • 8
  • 14