Hi,
Can anyone give me a guidance for implementing a chat appln in iPhone.
Regards, Sreelash
Hi,
Can anyone give me a guidance for implementing a chat appln in iPhone.
Regards, Sreelash
sure its good idea. you need to study how socket works in iphone. Also such application need to have an intermediate server that will monitor all activities i.e. who is online, who is chatting, what was the last message sent and store it in chat history etc.
So what this app needs to do is provide user with registration and login screens that will occur with the remote server and its implementation is pretty obvious.
So when user signs in you need to record that information that he is available in the server using NSURLConnection class and same for the sign out.
When user signs in you need fetch list of his friends from server and populate UITableView or any other view you are using. That list must be in JSON format that should tell him which is friend is online since we are recording that information whenever any user signs in.
Now whenever user touches on any of his contacts then get there ipaddresses(record that information too when user signs is) and create socket between them. In the mean time when they are communicating then you need to send each information to the server say when they click send message button using NSURLConnection, that will usefull if they want to have chat history.
Thats it you, follow these steps and you can have nice chat application ready within few days. Also for JSON and sockets use libraries that are available for example touchjJSON etc.