I want to create a chat client application for iPhone. I’ve read that the XMPP framework is one of the best to use for this. However, I haven’t found much material out there on this, only the XMPPFramework on Google Code and details about it on a wiki.
Can anyone explain what XMPP is and how we can use it within our chat application? Are there any tutorials or code snippets out there that demonstrate its use?
XMPP is an open protocol for messaging and presence that most IM clients support.
If you’re building a chat app for iOS that needs to interact with other clients, use XMPP. Read up and understand the protocol first, then look at the XMPPFramework Objective-C lib and it should all make sense. It’ll take some time to learn though.
If your chat app needs to only communicate with other installations of your app, then you have a few easier options:
You could open a persistent tcp connection with the server and use that to pass presence and message data back and forth. You could implement a simple server to do this in node.js, for example, in a relatively small amount of code.
An even easier option is to call a simple http based api when you want to report new messages or presence changes from the iphone and deliver updates via push messages. Push messages are good because when the app is closed you can still deliver the message and when the app is open you can intelligently update your app’s interface.
It’s all about your requirements.