2

I'm wondering if anyone knows of a place where I can get a tutorial on building a simple IM-style chat app between two iphones? Hopefully involving push notifications, though that's not as necessary.

Thanks!

Mason
  • 6,893
  • 15
  • 71
  • 115

1 Answers1

1

I don't know of a tutorial, but you will need to use two things:

  1. Socket Programming. - To establish connection between the devices, and transfer data through sockets.
  2. NSNetService/NSNetServiceBrowser - To publish your services.

Google these 2, and you'll be good to go!

T.Rob
  • 31,522
  • 9
  • 59
  • 103
Bani Uppal
  • 866
  • 9
  • 17
  • Why do I need to use socket programming? Won't the devices be behind a NAT, obscuring the public IP addresses? I figured I'd have to just query the server every so often to see if a new message has been received. That being said, I don't know very much about instant message systems in general, so I don't exactly know how it's done, but I do know a little about socket programming in C. Does iOS have its own sockets library, or do you have to use the C socket library? Thanks, btw! – Mason Dec 20 '11 at 15:33
  • You would require a chat server. You can either go for chat server providers, they might have APIs for that, I am not sure about that. I am assuming you can just open a chat room kind of thing, and whoever has your app installed can chat with anyone else having the same app. If that is the case, then you would require Sockets. BSD sockets work in iPhone also. You can also checkout the CFNetwork framework. Plus some bit of stream programming. All the best!! – Bani Uppal Dec 21 '11 at 10:19