Is it possible to choose a wi-fi connection from within an application?

Discussion in 'iOS Programming' started by lilmul123, Jul 27, 2009.

  1. lilmul123 macrumors newbie

    Joined:
    Jun 30, 2009
    #1
    I would like to be able to change to different wi-fi connections from within my application; is this possible? If so, how?

    Also, is there a way to determine the IP of the connection I am currently connected to within my app?
     
  2. lilmul123 thread starter macrumors newbie

    Joined:
    Jun 30, 2009
  3. moral-hazard macrumors regular

    Joined:
    Jul 27, 2009
    Location:
    Palo Alto, CA
    #3
    I would tend to doubt the ability to switch wi-fi connections within the app.
    As for getting the IP address, there is definitely a way. I don't (explicitly) know that apple offers a way to do this internally.

    A "hacky" way to do it would be to grab the source code of one of the pages that tells you your IP address (like IPChicken), since it would show up in the HTML source. Obviously this would only work when you are connected, but you would only have an IP when you are connected to the internet, but I would assume that 99% of the time you are connected to a WiFi connnection, you would be so that's not really a concern.

    Obj-C doesnt offer much in the way of regular expressions, but you could certainly parse it out somehow. Be creative.
     

Share This Page