How to build Instant Messenger in iPhone?
Asked Answered
F

3

6

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.

Funk answered 16/12, 2010 at 11:43 Comment(2)
Your question is too large. Edit with what you already found, and what specific needs you have. Also you say you want to use objective-c for the server. Do you mean the client ? If not, what are the constraints for your server (were it's hosted, how many clients you expect connected...)Freiman
no reason to close this message. he's only looking for "information/advice" as he says. its difficult to know where to start on these type of applications, and even just getting a keyword like "persistent connection" or "xmpp" can help. I recently found out about XMPP servers after spending a week or so writing a HTTP interface for a similar app. I wish I'd asked sooner! :pSenhauser
P
5

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.

Provence answered 16/12, 2010 at 11:52 Comment(5)
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).Senhauser
i thomas can u provide more information regarding this aspect?thank you in advanceFunk
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 serverSenhauser
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. :)Senhauser
ah thank u thomas and can u guide me more information on XMPP (like materials or links)on it...Funk
M
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 :)

Marcheshvan answered 27/7, 2011 at 2:29 Comment(0)
M
0

Are you set on building your own instant messenger or are you looking for the code to put into your app?

I came across an interesting article from someone who seems to have been looking for the same thing as you, he looks at the problems different open source instant messenger codes have and how to try to pull them together:

my-quest-make-messaging-app-ios

There are also chat components available to buy ready-made which have the advantage of not requiring the time to develop and bug test. For example:

chat-messaging-sdk-for-ios

Metabolic answered 22/8, 2014 at 10:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.