Hacker News new | ask | show | jobs
by vaughan 4661 days ago
I was recently working on an iOS app where I needed a 1-to-1 chat feature. I was surprised that there wasn't an established market leader in this space considering how many apps use such a feature. When I saw this post I immediately thought "yep, that is a gap I'd seen in the market".

Some existing platforms included Scringo, Lobi SDK, QuickBlox. None seemed polished or customisable enough for my purposes. See more here: http://www.quora.com/Are-there-any-existing-APIs-for-impleme...

I ended up using an open-source iOS chat UI control (https://github.com/jessesquires/MessagesTableViewController) and Firebase (here is a sample project of a real-time iOS chat app: https://github.com/firebase/firechat-ios). It was incredibly easy to setup a real-time chat app and provides me with full UI customisation and a flexible and scalable data backend.

Send and receive code:

    // Setup.
    self.firebase = [[Firebase alloc] initWithUrl:kFirechatNS];

    // Listen for messages (real-time).
    [self.firebase observeEventType:FEventTypeChildAdded withBlock:^(FDataSnapshot *snapshot) {
        // Add the chat message to the array.
        [self.chat addObject:snapshot.value];
        // Reload the table view so the new message will show up.
        [self.tableView reloadData];
    }];

    // Send message.
    [[self.firebase childByAutoId] setValue:@{@"name" : self.name, @"text": aTextField.text}];
Thoughts on Layer

If Layer was around when I was looking I would have tried it out, however I am happy with Firebase as my backend now. The API looks insanely easy to use though.

Media sharing features would be difficult to implement using what I described above so Layer would be advantageous here.

Great branding.

Also Layer, please make your iOS framework available on CocoaPods.

3 comments

Everything you saw on the presentation will be available with very few lines of code. By using Layer SDK you will get messages sync cross devices, delivery notifications, delivery dismissal when a message has been opened (if using multiple devices), offline messaging thats syncs when you come back online. All you'll have to do is to define a search query for your UITableViewController and style your UITableViewCell and you are done, we'll take care of everything else.
As I understand Layer also has offline/sync functionality, contacts & some UI goodies to glue all of these together.
Thanks, this is great feedback! Please get in touch with us, we'd love to chat more - hello@layer.com