views:

448

answers:

3

If yes, can we also get additional information about the network configuration?

One useful way to do this could be getting the SSID of the current network. Is there an API to do that?

Update: I found a similar question here:

http://stackoverflow.com/questions/339089/can-the-iphone-sdk-obtain-the-wi-fi-ssid-currently-connected-to

A: 

Have you looked at the Reachability sample app?

Edit: The Reachability app demonstrates the use of the SystemConfiguration framework to show whether your phone's connected to the internet and, if so, how.

It further allows you to distinguish between a local WiFi connection and not (+[Reachability reachabilityForLocalWiFi]).

Regarding the meat of your question, you'll have to consult the phone's ARP table. This answer shows you how to do just that.

Frank Shearar
Perhaps you could clarify your answer. Are you saying "yes, you can, here's a link to some sample code that does it" or are you saying "no, you can't; but here's an idea of the other things you can do." Or are you saying "I don't know either, but look over here" which really would be better as a comment, as it doesn't answer the question.
T.J. Crowder
The reachability sample only demonstrates detecting IF we are connected to a network. It does not show how we can get the current network's identification.
Plumenator
What do you mean by a network's identification? Do you mean the SSID of a WLAN?
Frank Shearar
Well, I wasn't sure what I wanted when I asked the question. But on some thought, yes, the SSID.
Plumenator
A: 

(Separate answer to preserve history etc.)

It looks like you might not be able to determine the SSID of the WLAN to which you're connected, at least in an app that will go into the App Store. These people use a private API - Preferences.framework - to get to the details of the WLAN (like "is it hidden?" "What's the name?" etc.).

Frank Shearar
A: 

Can't comment, but this might be a duplicate:

http://stackoverflow.com/questions/351954/accessing-iphone-wifi-information-via-sdk

Answer seems to be no. I've done my own research on this and have been unable to find a supported way of getting the SSID.

Gordon Christie