18

This is not a duplicate of the dozens of similar questions (too many to list) because I have evidence that it is possible to publish an app that displays a list of wifi networks.

So, it has been widely accepted and understood that you cannot get a list of all wifi networks without using a private api. The use of a private api will cause an app to be rejected from app store review.

However, Google did it recently in their Google Home app that was released on 10/26/2016, so it must be possible now. How?!?

Note- their App Store listing says the app supports iOS 8.0 or later. I need to further test if this functionality only exists on the iOS 10 version of the app, or if it in fact also exists on iOS 8 and 9.
(I grayed out my wifi name and mac address in the image)

enter image description here

I'm using Objective-C, so if you submit a solution in Swift, please submit an ObjC one too!

jungledev
  • 4,195
  • 1
  • 37
  • 52
  • 5
    The use of a private API will cause *your* app to be rejected. That doesn't mean *all* apps that use a private API will be rejected. – woz Nov 18 '16 at 16:55
  • 8
    Did you think of that Googles App connects via bluetooth to the google home device and this device responds with the list of WiFi-Networks? – OliverD Nov 18 '16 at 17:33
  • OliverM has a valid point here. If you don't turn BT on you are instructed to go to OS settings and to connect to home devices temporary hotspot WiFi network and then return back to the app to continue with setting up procedure. – Rok Jarc Nov 18 '16 at 17:47
  • @OliverM I suspected that was the case. Still worth asking, just to be sure. Woz, could you elaborate? – jungledev Nov 18 '16 at 18:11
  • 2
    Jungle we would very much like to do this in our app but it simply was not possible a year ago or so. I'm positive Google is doing this over bluetooth. We've opened tickets with Apple and were told this was simply not available. – Dave S Nov 18 '16 at 18:12
  • Possible duplicate of [iPhone get a list of all SSIDs without private library](https://stackoverflow.com/questions/9684341/iphone-get-a-list-of-all-ssids-without-private-library) – Senseful Sep 24 '18 at 06:11
  • @Senseful, not a duplicate because my question was clearly stating 'Is it possible *now*..' (at the time of the post) based on the new evidence. – jungledev Sep 24 '18 at 13:11
  • @jungledev: I agree and like the reposting. However 2 years passed, and I think having a single question with all solutions (old and new) could benefit the community. I wanted to make sure this question is linked to the original, and marking as duplicate is one way to do that. I also refreshed the original's content to hopefully entice more relevant conversation. – Senseful Sep 24 '18 at 22:07

1 Answers1

10

This might be possible with NetworkExtension (available since iOS 8). But you need the com.apple.developer.networking.HotspotHelper-entitlement in you app to use these APIs. To get these entitlement, you have to contact Apple and describe, why you need it.

I haven't found any code examples, but maybe the documentation of NetworkExtension helps you.

FelixSFD
  • 6,052
  • 10
  • 43
  • 117
  • I‘v been refused by Apple Network Extension Staff for two times for getting this entitlements. Now, I'll apply for one more times. Could you suggest on How could I explain the use of purpose of my application, so that they will agree my apply ? – Johnny Apr 20 '17 at 06:54
  • Do you find any solution? – Nupur Gupta Feb 16 '18 at 09:43
  • NEHotspotNetwork will only return a list of networks when the user navigates to the Wi-Fi page in Settings. See [this answer](https://stackoverflow.com/a/52473480/35690) for more details. – Senseful Sep 24 '18 at 06:10
  • @VictorJohn did you succeed? I am using below code: NEHotspotConfigurationManager.shared.getConfiguredSSIDs { (ssidsArray) in print("ssidsArray.count==\(ssidsArray.count)") for ssid in ssidsArray { print(" Connected ssid = ",ssid) } } but it only return connected Wifi. – guru Jul 04 '19 at 08:14
  • Hey @guru try this. When entering wrong ssid and password, Wifi is not conencted also we dont get any error in closure. – Kudos Apr 16 '21 at 11:10