Does iPhone support WiFi ad-hoc mode?

30,808

Solution 1

Updated Answer:

Have a look at the MultiPeer Connectivity Framework (documentation link) introduced in iOS 7. NSHipster has a nice write-up on it (link). Although you don't get direct network access, you can easily pass data between devices, and even use other devices to act as middlemen to other devices nearby.

Legacy Answer:

iOS devices cannot make peer-to-peer networks using the built in Settings app or available APIs. However, if you want to send data between devices in your app you have three options.

You can use Game Kit, CoreBluetooth (in limited circumstances), or you can use something like CocoaHTTPServer.

Solution 2

Ad Hoc networking is supported on all iOS devices, but you can not create an ad hoc network from within your application. From the list of available networks, choose the ad hoc network you want to connect to, click the arrow and choose connect automatically. Now, your device will automatically connect to this network whenever it comes within range. After this you can use the connection using regular sockets or any other networking API.

Solution 3

As of iOS 7 you can use the Multipeer Connectivity Framework to connect two iPhones without an existing network. The framework will use Bluetooth, Wifi infrastructure mode, or Wifi Adhoc mode. Unfortunately, you don't have the ability to choose a transport, the framework decides on what is best.

Share:
30,808
Jing
Author by

Jing

Updated on February 13, 2020

Comments

  • Jing
    Jing about 4 years

    Does the iPhone support ad-hoc network mode? Can iPhones connect to one another without requiring an existing network? If so, how can I create an Ad Hoc network in my app?

  • Jing
    Jing over 12 years
    I'm working on Gamekit/Bluetooth with multi-user, crash very often. I'm trying to understand CocoaHttpServer project,sorry my networking knowledge is poor, does it means I don't need wifi hotpot around? What job does it do?
  • Andy
    Andy over 12 years
    Ad hoc wifi networking IS supported, but you can not CREATE one.
  • Dermot
    Dermot over 11 years
    I think he meant between iPhones, its the context of the question.
  • Andy
    Andy over 11 years
    This is incorrect, it is supported, but you must specify the connection parameters in the settings app.
  • Andy
    Andy over 11 years
    Yes, it is supported BETWEEN phones.
  • Andy
    Andy over 11 years
    No, it wasnt as it has been for several years, so you were incorrect at the time of posting. Retaliation downvotes IS REALLY BAD BEHAVIOR! You better stop this immediately and start posting correct answers, or accept that you may be wrong. We all are sometimes.
  • Mr47
    Mr47 over 11 years
    ...iPhones connect to one another... Your answer implies yet another device creating a network.
  • Art Geigel
    Art Geigel almost 11 years
    This might have been the right answer in November 2011 but it appears to not be the case anymore... Whenever I try to connect to an ad hoc network from within Settings on the iPhone I get "Unable to join the network" message.
  • Art Geigel
    Art Geigel almost 11 years
    WTF, just for fun I reset my iPhone and tried to connect to the ad hoc network again and I was able to... if you're seeing the connection problem I described above may want to try this.
  • David Doria
    David Doria almost 11 years
    @Moshe Any thoughts as to WHY this functionality is not enabled/allowed? It seems strange to me.
  • Moshe
    Moshe almost 11 years
    Probably limitations of earlier devices. Of course there are some surprises coming this fall. Watch session 708 from WWDC 2013.
  • SeB.Fr
    SeB.Fr about 10 years
    For jailbroken ios you can use Mywy or Pdanet to create hadoc wifi network