How to build Instant Messenger in iPhone?

11,309

Solution 1

The main protocol used to connect to those services (or even your own) is XMPP (also known as Jabber.

It connects to a Jabber/XMPP server that manages the sessions. XMPP works with Skype, Google Talk, Facebook chat and many more.

I've successfully implemeted a google chat app using this open source XMPP library that fits in very well into iPhone:

http://code.google.com/p/xmppframework/wiki/iPhone

Update

Library now moved to GitHub: github.com/robbiehanson/XMPPFramework as Raspu pointed out

You should be able to rather easily get that up and running. It even comes with a Google talk example.

Solution 2

You can use Kik API to build your mobile app on top of Kik's instant messaging transport and infrastructure. The API is available for Android & iPhone and lets your app to transfer rich content and files in between mobile app users. It is also very easy to use - only 5 lines of code are needed to integrate, in simpler scenarios. There's more info on Kik API website: http://www.kik.com/dev or http://apiblog.kik.com

Disclaimer: I'm one of the developers behind Kik API :)

Share:
11,309
satya
Author by

satya

Updated on July 07, 2022

Comments

  • satya
    satya almost 2 years

    I'm looking into building an IM-type application for iPhone using Objective-C. I'd be interested to see any information/advice on how applications like Skype/AIM/MSN work, as well as any technologies/APIs that might be relevant.

  • Thomas Clayson
    Thomas Clayson over 13 years
    the xmppframework is quite complicated. :p I'm currently doing this. basically XMPP servers allow for persistent connections. so instead of connecting, checking for updates and then downloading them the server "pushes" new messages to you down the persistent connection. You will need an xmpp server like Openfire (thats what I'm using... its very good).
  • satya
    satya over 13 years
    i thomas can u provide more information regarding this aspect?thank you in advance
  • Thomas Clayson
    Thomas Clayson over 13 years
    basically the way HTTP works is you connect to the server, download a website or some data and then close the connection. This is why you have to "refresh" websites and such. XMPP works by opening a persistent connection. That means that the connection never closes (unless there's a problem or similar, in which case you just reconnect). What happens is when the server receives new data it "pushes" it down the connection to your client instead of your client requesting it. Regarding the server basically apache is a HTTP server... when you get your email you get that through a POP3 server
  • Thomas Clayson
    Thomas Clayson over 13 years
    well... similarly with XMPP you need a specific server type for that. We have dedicated hosting where I work and thus we were able to install openfire (igniterealtime.org/projects/openfire) if you've got shared hosting then you're going to need to run your own server or pay for an upgrade. Not sure if you can buy dedicated XMPP servers, but I'm sure if you look around you can find out. :)
  • satya
    satya over 13 years
    ah thank u thomas and can u guide me more information on XMPP (like materials or links)on it...