Real-time Chat Blog

Smacktive Creates Social Discovery Android and iOS Chat

3 min readPubNub Staff on Oct 12, 2014
Try PubNub Today

Free up to 1MM monthly messages. No credit card required.

Subscribe to our newsletter

By submitting this form, you are agreeing to our Terms and Conditions and Privacy Policy.

Building a scalable and reliable Android and iOS chat application with PubNub Data Streams and Storage & Playback is easy! Here's how Smacktive did it.

Good News

Good News! We’ve launched an all new Chat Resource Center.

We recommend checking out our new Chat Resource Center, which includes overviews, tutorials, and design patterns for building and deploying mobile and web chat.

Take me to the Chat Resource Center →

smacktive ios chat

Smacktive is a social discovery app with a mission to create new, meaningful friendships while playing sports, exercising, playing table games with people near you. With a slick interface and easy-to-understand user experience, Smacktive launched October 8 in New York City and has already started to consider how to scale. To power this scaling, they are using PubNub behind the scenes to manage the real-time data streams of their installed user base.ios chat smacktive ios chat smacktive

Building Scalable and Reliable Android and iOS Chat

Peer-to-peer social discovery and communication is a difficult problem that iOS and Android developers have to address as their app becomes more and more popular. With n unique users, your peer-to-peer messaging system has to deal with O(n2) total data stream pathways from each user to any other user. By building your chat system on top of PubNub’s publish/subscribe architecture, you can leverage PubNub’s global platform with 15 redundant data centers to ensure that each message is delivered as fast as possible. As your app’s installed user base grows, your O(n2) messaging issue is moved off of your hardware onto PubNub’s global cloud, eliminating points of failure in your infrastructure and increasing reliability during traffic spikes.

Harnessing PubNub for Chat

Getting started with PubNub chat in your iOS app is easy, using the PubNub iOS SDK. To publish a message, it’s as simple as:

Storing Chat History with PubNub Storage & Playback

ios chat

Chat conversation history is a staple of chat applications today. Users have come to expect to see a personalized conversation history with their contacts. Unfortunately, this is a feature that a standard publish/subscribe messaging architecture doesn’t include.

Enter PubNub Storage and Playback.

Each message sent over PubNub is stored for later retrieval with Storage & Playback, and can be queried using the same PubNub SDK that powers your messaging functionality. This eliminates the need for your servers to store chat data (although you can do this, if you desire, by having your server issue periodic history calls to active channels).

Using PubNub Storage and Playback, a user of your app can open their message history, send a message to a friend, receive a message from a friend and carry on a conversation without hitting your servers at all. And with PubNub Channel Multiplexing, your user can carry on simultaneous conversations with multiple users through the same TCP socket.

Walk Me Through It

Does your app require chat functionality? See our blog post Building an iOS Group Messenger App for step-by-step instructions, an Xcode walkthrough, and sample code. It’s a quick and dirty tutorial on getting your chat application for iOS up and running fast.

More from PubNub

Can Empathy Exist in the Metaverse
News May 16, 20221 min read

Can Empathy Exist in the Metaverse

A roundtable discussion led by PubNub’s COO, Casey Clegg, exploring the topics of what it means to be human in a virtual world.

PubNub Staff

PubNub Staff

How to Advance Telehealth and Virtual Care Technologies
News May 2, 20221 min read

How to Advance Telehealth and Virtual Care Technologies

Dr. Joe Kvedar, Chair of the Board for the American Telemedicine Association, joins our COO, Casey Clegg, to discuss why...

PubNub Staff

PubNub Staff

Another Step Towards Data Security: ISO-27001 Implementation
BuildMay 2, 20221 min read

Another Step Towards Data Security: ISO-27001 Implementation

Today, we are glad to announce that we are currently in the process of implementing ISO-27001 security standards.

PubNub Staff

PubNub Staff