This post is part of our Building Blocks series, which provides comprehensive guides on common features of web and mobile apps. First up is chat, including how to build chat into your app and why it’s a good idea.

Our human need for real-time communication has officially evolved from SMS texts with our friends to just about any online interaction with anyone. That’s why we’re seeing a rise of chat features in more than just chat-based apps.

When you think about online businesses with chat, customer service is generally the first thing that comes to mind.

Live chat can indeed be a great replacement for a 1-800 number or a general “help@” inbox that floweth over. But, there’s a lot more you can do to enhance your all-around user engagement through the art of chat.

We talked to people at three communications companies about the current climate of chat and how best to harness all it has to offer:

  • Derek Frome, Head of Product Marketing at PubNub. PubNub is a DSN that offers real-time apps across multiple platforms.
  • Christian Jensen, Chief Evangelist at Sinch. Sinch is a cloud-based communication service that provides APIs to add calling, messaging, and verification to apps.
  • John Eberly, Founder of Chatlio. Chatlio is a service that provides live chat powered by services you already use, like Slack.

How to Build Chat into Your App - Chatlio

Why to Build Chat into Your App

Our need for chat is summed up pretty well in this statement from PubNub’s Derek Frome: “People expect the online world to behave with exactly the same responsiveness as the offline world.” And that goes for different forms of chat.

Company to User/User to Company

A voice from the company can answer any pre-sale questions that may keep a user from buying. You can also chat with your user as a real-time form of customer service.

User to User

Users can talk to one another as a way to answer each other’s questions or just to build community. When users can talk to one another, your product engagement is higher.


Chat isn’t just linked to the web. Sinch’s Christian Jensen pointed out that SMS is still the most-opened form of text messaging in the world, though web-based IM also has its benefits.

Short Text Messaging (SMS)

SMS (text messaging) is a great delivery method because it is available whether or not you have WiFi, data coverage, or even a smartphone. In fact, it is estimated that the average SMS message is read within the first three minutes of receipt, according to DocStoc.

This makes SMS notifications better suited to the more business-critical forms of engagement. For instance, ridesharing apps like Lyft and Uber use SMS to notify users that they’re about to be picked up. Food delivery companies such as Instacart notify their customers of time-critical events, like the delivery person arriving at their doorstep.

SMS also presents a form of two-way communication between the company and customer in the familiar, clean environment of your messaging app instead of in the company app. This allows users to keep a record of their interaction in the place where they most often communicate.

For example, Luxe is a car valet company that uses SMS to engage one-on-one from drivers to customers. Unlike Uber or Lyft, it goes beyond broadcasting a status and encourages customers to respond back and ask questions.

A service like Sinch can provide a platform for these kinds of exchanges. Sinch has a RESTful API that supports two-way (inbound/outbound) SMS communications between apps and consumers.

For inbound SMS communication, Sinch provides REST methods to detect and capture text message replies, allowing the app to react accordingly. The SMS numbers are rented out by Sinch, to provide a consistent, localized number endpoint.

Sinch caters to outbound text messaging in their API by providing endpoints, so you can check the status of each text message, when it was sent, when it was delivered, and any delivery failures. You can find more information on Sinch’s SMS RESTful API here.

How to Build Chat into Your App - Outbound SMS

SMS can also encourage users to authenticate themselves and their profiles with their unique phone number in lieu of revealing their entire personal and social identities, as Twitter’s Digits platform advocates. After providing their phone number, they receive a confirmation code that they enter into the app. This authenticates the user.

You can also send out SMS verifications, such as sending a one-time, time-sensitive pin code to verify a user. This is best used for critical information, like a bank code to verify a user’s identity or a notification of an Amazon Prime delivery.

The quickness of reading a text message, along with the fact that SMS is independent of any specific app, makes for a powerful engagement model with a guaranteed rate of delivery — something that push notifications on mobile devices just can’t do. What push notifications can do is allow for new and different forms of interaction between the user and the app.

Instant Messaging and Push Notifications

Instant messaging allows for in-app direct communication, also dubbed “socket communication.” Here, users interact in real-time, relying on an Internet connection rather than their phone carrier’s SMS network.

Like SMS, instant messaging provides great real-time one-on-one customer engagement. But, there’s also the ability for added features like group conversations and GPS locations. Chat within an app or on the web can provide visual indicators to show that another party is in the process of typing or that they’ve read the message. They can also share, report, or delete a specific message.

You’re probably already familiar with apps like Facebook Messenger, WhatsApp, and Google Hangouts, all of which use instant messaging within the confines of the app. Users are alerted to new messages through push notifications, visible on their device status bar or notification center.

As of iOS 8, push notifications for iPhone apps can also provide designated action buttons, such as to “Mark as Read” or “Check In” (with Foursquare). With Apple Watch, these notifications allow for brief and quick responses from the user, without the need to pick up their phones.

How to Build Chat into Your App - iOS Push Notification

Image credit

The downside of push notifications is that mobile permissions can be tricky to manage. The app is required to prompt the user for permission to receive notifications. If the user somehow denies the app authorization once, the user will have to go through their iPhone’s settings to re-authorize push notifications, which is definitely a bit cumbersome.

There’s also no guarantee that the user will receive them. So if the message is time-sensitive or important, it is best to revert to SMS. For instance, messages between users on Facebook Messenger are probably not as critical as a reminder that your Lyft driver is waiting outside.

This year, Facebook took customer service one step further by providing a platform for businesses and customers to communicate ubiquitously through the Facebook Messenger app. It’s called Business on Messenger and, through APIs, it enables businesses to engage their customers immediately after checkout to provide order confirmations and delivery status updates. Customers can also respond to businesses with questions about their orders.

How to Build Chat into Your App - Facebook Business Messenger 1

How to Build Chat into Your App - Facebook Business Messenger 2

Image credits

Ways to Build Chat into Your App

Chances are, no matter what your product, there’s a use for a chat feature.

From productivity software to mobile games, when you increase live connectivity, you add a new level to an otherwise stagnant web or mobile presence.

How to Build Chat into Your App - Twitch chat

Community Building/Engagement

If you’re starting out with a community-based product, letting your users chat with one another is a tremendous opportunity for them to build their own relationships and really show off their personalities. Sites like Twitch have even enabled group chat capabilities to facilitate focused conversations (as seen above).

Interest in mobile games is notoriously fleeting (perhaps with the exception of the ever-addicting Angry Birds and Candy Crush). But, with the addition of chat, the trivia game QuizUp found that people were staying in the app longer and coming back more frequently. By enabling personal relationships and providing a sense of community, QuizUp has become more than just a game (and if you don’t believe us, just check out the video above).

How to Build Chat into Your App - WorkChat

Collaboration, Amplified

Working with people through email makes for a clunky, non-intuitive experience. So, productivity apps like Evernote have bypassed the communication relic altogether by adding chat directly into their service. This also keeps users in their app longer. Seeing a pattern here?

Their chat feature is called WorkChat. It lets you talk with team members and clients right within the project you’re working on together, saving everyone time reading, typing and opening new tabs/apps.

How to Build Chat into Your App - Periscope chat

Live Feedback for Live Streaming

Meerkat, Periscope, YouNow — no matter which one you pick, with chat, you’re giving your audience the ability to talk to you in real time. In our chat-centric world, this may seem like an obvious feature. And maybe it is, but it’s still a really big deal.

Chat gives viewers the power to directly ask the person who is streaming to do something, answer a question about where they are, or just give a shoutout in real time. Adding chat to an already live form of media makes for a whole new kind of conversational experience that provides immediate satisfaction.

How to Build Chat into Your App - Sinch

Customer Service

Often we start looking into buying something online, but without even realizing it, we stop on account of unanswered questions. Then maybe we leave the tab open for a while only to forget why we ever had it open in the first place.

But, when a company rep pops up in a chat box asking if you have any questions, your passive decision becomes an active one. Also, the company becomes more than just a web page. As John Eberly of Chatlio explained:

“Having live chat as part of the sales funnel greatly increases conversions because you can engage the customer with the few questions they might have during the most critical stages of the signup process, which means a live chat product can more than pay for itself.”

Real-time satisfaction is also an asset to customer service and giving users immediate feedback on any issues that they’re having. The less time they spend fuming, the more time you have to win back their business.

Basic Requirements for Chat Features

Before you build a chat feature or choose a chat software, here are some things you need to consider.

Time Is of the Essence

Jensen said that people expect you to be online all the time, especially on mobile. So make sure that, if you’re enabling chat on your site or app, there is someone on your end to chat back.

Eberly added, “Make sure you have an internal process for [people who are] responsible for handling incoming chats … The worst thing you can do is offer live chat and not respond in a timely fashion.”

If for some reason there isn’t someone available, give your user an email option.

Get to Know Your User

Eberly said, “In addition to those most basic features of chat, I feel any good web live chat platform should support automatically identifying traits about users from their location, platform, and a custom set of data specific to your product.”

The emergence of big data over the past few years means there is great potential for data mining, in which cloud-based databases can collect large amounts of data sets from user interactions and extract meaningful information for future use.

With the addition of deep learning from data mining, algorithms can make meaning of free-form text like text messages, creating contextuality and sentimentality. This is important because it derives meaning from unlabeled data (conversations), giving companies the ability to truly understand their customers through developing user patterns, whether the sentiment over a particular topic is positive, neutral, or negative.

If a customer is using your messaging platform to send a complaint about a particular product, and another user is also sending a complaint about the same product, sentiment analysis and deep learning can create an association between the two different conversations. This allows for a pattern to emerge showing that a particular product is receiving negative feedback, along with pattern collection of what adjectives are used to describe their experiences.

With the help of chat transcripts, Eberly said you can follow up with people on their personal experiences with your product.

Stay Connected

Though it feels automatic most of the time, when you or your user loses phone or Internet connection, you could lose a user.

Frome of PubNub advises, “You need to manage disparate connections, switches between WiFi and 3G and 4G cellular connections, private firewalls, and much more. Delivering messages reliably with all those drops and reconnects is a big challenge, not to mention maintaining compatibility across devices and operating systems.”

Get a Scope of the Possibilities

Not all products/websites need all the features of chat. But, when you know what’s possible, you can get a better idea of what best suits your needs. The next sections describe how to get started with your chatting potential.

Adding Instant Messaging into Your App

Sinch provides iOS, Android, and web (JavaScript) support for instant messaging.

To use Sinch’s SDK, you start by registering your app in order to receive the required keys and tokens that are applicable for your app. Then you download the SDK appropriate for your platform (Android, iOS, or web).

To integrate messaging into your app (on iOS), you would start off with something like this:

SINClient sinchClient;

[sinchClient setSupportMessaging: YES];

SINMessageClient messageClient = [sinchClient messageClient];

// Assign a delegate for instant messages events

messageClient.delegate = …

SINOutgoingMessage *message = [SINOutgoingMessage messageWithRecipient:@”<recipient user id> text:@”Hi there!”];

You must create a SINClient object, enable messaging support, and hook up the delegate. Then you pass the message you want to send (normally this would come from a text field on your app) and call:

[messageClient sendMessage:message];

You can download an example messaging project from Sinch, which will help you understand how to construct a complete messaging platform. There is a lot more to working with messaging, though, so you should also consult Sinch’s documentation.

Adding SMS into Your App

You can also use Sinch to send outbound and receive incoming SMS messages using the SMS Messaging API. (Just remember to first rent an SMS-enabled number.)

To send an SMS using the company’s RESTful API, you would utilize the POST endpoint:{number}

Of course, prior to using this method, you would need to be authenticated using oAuth. {number} refers to the mobile number you are sending to. Additionally, you are required to include this in the body:

‘{“message”:”your_message”, “from” : “+11111111111”}

As a response, you would receive:


This response could later be used as a reference, such as to verify the status of the sent message. The possible responses include unknown, pending, successful, or faulted.

You can follow the source code for creating a voting app with SMS (in Ruby), which is available iSinch’s tutorial section. Consult the documentation we referenced previously to find out how to respond to inbound SMS messages.

Adding Voice Calls into Your App

In addition to instant messaging and SMS, Sinch gives you the ability to interact with switched telephone networks (PSTN) using high-quality voice termination to over 150 countries. The company supports both outgoing and incoming calls (through an app and data or via a local phone number).

Sinch classifies and supports the following types of PSTN applications:

  • App-to-app calling
  • App-to-phone calling
  • Phone-to-phone calling

App-to-App Calling

Here are some of the functionalities of Objective-C for iOS, starting with a simple app-to-app calling interaction (assuming you have already gone through the setup process to create a Call Client):

id<SINCallClient> callClient = [sinchClient callClient];

id<SINCall> call = [callClient callUserWithId:@”<remote user id>”];

You get back a call object with the details of the participants in the phone call, including start time, call state, and possible errors.

When the delegate method callDidProgress is triggered, it notifies your app that an outgoing call is in progress. When the targeted party answers the call, a callDidEstablish delegate method is called, allowing for further information and customization to be made.

App-to-Phone Calling

To conduct an app-to-phone calling interaction, we would simply switch the use of calluserWithId in the code above with callPhoneNumber, passing in the phone number to call.

Once again, Sinch’s documentation provides complete coverage of what you can do with phone calling, as well as working with other platforms, such as Android and the web. Sinch also has a sample phone calling app for Android, which guides you through creating the UI as well as phone calling methods.

Adding Video Calls into Your App

Finally, Sinch also allows you to add support for video calling.

Currently the SDK is only available for web/JavaScript and is still under development, and therefore not stable enough for production. Nevertheless, you start off by setting up the Sinch client as well as its capabilities.

var sinchClient = new SinchClient({applicationKey: ‘…’, capabilities: {calling: true, video: true}}); // Notice the video capability

var call = sinchClient.callUser(‘<remote user id>’);


The attribute video: true adds video capability to normal video calling, which is set up in the same way as we had done for voice calling. For handling callbacks and other methods related to the video call session, you would consult the audio calling section of the Sinch documentation.

Consult the documentation for other advanced functionality, such as working with push notifications. Sinch also provides a tutorial section with dozens of sample apps that cover a multitude of scenarios, complete with full-code and explanation.

Chat Is a Win-Win

Whether you’re using it for user engagement or sales conversions, enabling chat brings efficiency to how your product operates and how people interact with it. It cuts out the most annoying middle man of all — time.


Additional reporting provided by Doron Katz. Feature image via SplitShire.

[Editor’s Note: This post was originally published on August 6, 2015. It was updated and republished on August 20, 2015.]

Ready to start your project?

Learn how ThinkApps can get your product launched faster, better, and with more value than you knew was possible.