All Blog Posts

Freeish Time: Building A Real Time Chat Mobile App

Even though it is turning out to be a long hot summer and everyone seems to be at the beach, we have been keen to continue ensuring that everyone in our production team gets their “Freeish Time” week. We sat down with Alex Errington, one of our fantastic Mobile Developers, to discuss his latest freeish time adventure…

3 SIDED CUBE
4 Min Read

Even though it is turning out to be a long hot summer and everyone seems to be at the beach, we have been keen to continue ensuring that everyone in our production team gets their “Freeish Time” week. For those that don’t know, “Freeish Time”, is the opportunity for our Cubes to work on passion projects outside of their work projects. They have an entire week to identify a problem, build and create a solution, then present it to the rest of the crew during our Friday Happy Half Hour meeting.

We sat down with Alex Errington, one of our fantastic Mobile Developers, to discuss his latest freeish time adventure…

What inspired your innovation time?

With my innovation time, I wanted to build a real-time chat mobile app. Building on some research that a member of my team produced into how we could build our own chat server, I was keen to look into how mobile will interface with it, and build a small demo.

I was excited to use my innovation time for this as I felt it would be good to have the knowledge for any future live chat integrations Cube might be interested in. But also this gave me a really great chance to practice native development as I planned on doing this project as a native iOS app for learning purposes.

Talk us through what you did

I decided to use xmpp., which is a communication protocol for message-oriented middleware and is made up of an agreed set of rules about how instant messaging should be implemented between devices. It covers everything from how messages are sent, to how contact lists should be structured, to read receipts. But the best bit is that it is extremely modular. You can see the ‘official’ definition below…

“Extensible Messaging and Presence Protocol, a set of open technologies for instant messaging, presence, multi-party chat, voice and video calls, collaboration, lightweight middleware, content syndication, and generalized routing of XML data.”

In terms of what I did, it was all about the build. This meant I had to evaluate a number of different XMPP client libraries and then plumb together XMPP clients with a UI framework. I wanted the UI to look decent without having to write custom UI code – so I ended up using an open-source library called MessageKit. This gave me everything I needed to build a (nice looking) chat interface and freed up a tonne of time! Using the XMPPFramework and MessageKit I’ve been able to develop a realtime chat application not dissimilar to something like WhatsApp.

This took me pretty much the whole of the week and you can see the demo below of how I got on!

What were the key learnings

I definitely did a lot of learning this week! I have learnt how XMPP works from a mobile perspective and been able to evaluate its strengths and weaknesses, as well as learn the underlying terminology and architecture behind the protocol.

There were also challenges! Picking up native iOS code again after working on JavaScript projects for so long was a bit of a paradigm shift for me. It’s an entirely different workflow, so I definitely spent a big chunk of the first day or so refamiliarizing myself with Swift. This combined with the task of learning how XMPP works were, at times, a complete information overload!

However, going forward, I believe I can take what I’ve been working on and develop it into a framework for any future chat applications/integrations 3 Sided Cube might be interested in building.

This Freeish Time is a great project to showcase as it is clear that Alex went on a massive learning journey but also managed to gain a load of new skills! It’s always so exciting to see what our Cubes can accomplish when they focus their genius efforts on something!

Published on 14 August 2020, last updated on 12 October 2020