Building chat applications is easier today than ever before. Technologies supporting low-latency publish/subscribe messaging, user authentication, and other must-have chat features are readily available and easy to use.
For Android developers, the Twitter Fabric platform is one of the best tools for getting a scalable app up and running. PubNub provides the low-latency messaging to power the actual chat messages, user presence monitoring, and chat history storage. Digits is a great option for user authentication.
We wrote two guides to get you well along the way to a fully featured chat app with only about an afternoon’s worth of work.
In this tutorial, you’ll:
- Log in with Twitter auth.
- Send chat messages to a PubNub channel (Chat): using the PubNub plugin for realtime messaging and Publish/Subscribe API.
- Display current and historical chat messages (Chat): using the PubNub plugin and History API.
- Display a list of what users are online (Presence): using the PubNub plugin and Presence API.
With the chat basics in place, you’ll need a method of user authentication to keep user data secure. Digits is an easy to use mobile identity provider that lets you authenticate user with their mobile phone, which increases engagement and makes email validation obsolete.
Although it isn’t covered explicitly, you can combine the user authentication with PubNub Access Manager for fine-grain control over which users have access to which chat channels. You can grant, revoke, and expire tokens both programmatically and manually as needed. All of the 70+ PubNub SDKs come with full end-to-end encryption at no extra cost. So you are pretty much only a couple steps away from the next WhatsApp, selling it for billions of dollars, and buying a Tahitian island. Or something like that.
Oh, and if you’re building a chat app, you definitely need to check out the PubNub BLOCKS catalog for chat applications. BLOCKS lets you program the network to handle application logic like chat translation with IBM Watson, spam filtering, and much more.