Clone wiki

Chatty / Home

Chatty + MYNetwork

This is a fork of the original Chatty sample app by Peter Bakhyryev. Chatty is "a simple chat application for the iPhone. It allows you to host your own chat room and advertise it on your local Wi-Fi network (in which case your app acts as a chat “server”) or find and join chat rooms hosted by other people on your network (acting as a chat “client”). Both announcement and discovery of chat rooms are implemented using Apple’s Bonjour protocol. The goal of this app is to show you how to use various networking-related frameworks available in the iPhone SDK version 2.x. The UI is minimal (consisting of only 3 simple views) - just enough to be able to play with the core functionality of the app without having to deal with complex UIKit code."

This fork is by Jens Alfke. It replaces the networking code in Chatty with my MYNetwork library, a general-purpose networking framework that provides Bonjour service discovery, client and server TCP streams, and a powerful messaging protocol called BLIP.

The functionality of Chatty hasn't been modified, and little of its code had to be changed (apart from deleting all of its networking-specific classes.)


MYNetwork has a number of features that could be made use of in Chatty. Here are some ideas of what you could add:

  • Have chat rooms show how many current members they have (using the TXT record) and display this in the room-list view.
  • Send photos (BLIPMessage objects can contain arbitrary data bodies, and have a Content-Type property indicating the MIME type.)
  • Post "So-and-so joined" and "So-and-so left" messages to the room as people join and leave.
  • Add private one-to-one messages as a special message type by using an additional flag property.
  • Use SSL connections to prevent eavesdropping. Currently this would require embedding a certificate (and private key) in the app since there aren't any iPhone APIs for generating new X.509 certs. So this wouldn't provide secure identification, just encryption.

--Jens Alfke