0

I am looking to create a chat app so that two iphones/mobile can chat with each other.

Can someone please head me in the right direction ?
1. Should I try to connect two devices directly using HTTP or TCP
2. Or should the communication pass through a server i.e. one phone sends the message to the server and server then push the message to other phone ?

If you can tell me any libraries/api that I should use, that would be greatly helpful too.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
user975027
  • 319
  • 7
  • 11
  • check out the possibility of [Bonjour networking](http://stackoverflow.com/questions/2477602/bonjour-for-iphone) and perhaps [some tutorials to go with it](http://mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/) – Michael Dautermann Feb 02 '13 at 04:37

1 Answers1

0

Or should the communication pass through a server i.e. one phone sends the message to the server and server then push the message to other phone ?

That's the usual approach. A server with a known address is easy to find; mobile phones that move from one network to another and frequently change their addresses are not. Also, you can keep a server running all the time, so that when one device sends a message, the server receives it and stores it until the other device becomes available. If you were to try to run your chat program on the phones all the time, you'd quickly deplete the batteries.

Caleb
  • 124,013
  • 19
  • 183
  • 272
  • Can you tell me how can I push the data to the phone when the app is running ? Should I do it using sockets or through some other way ? – user975027 Feb 02 '13 at 04:58