This guide provides developer-friendly documentation for building a chat application using the PubNub SDKs. It contains quick start tutorials in three common languages, and also includes use case-based code samples and common design patterns.
The PubNub Data Stream Network (DSN) empowers you to provide an ”always-on, realtime" experience to your application's users. PubNub's enterprise-grade security, global replication, and 99.999% uptime SLA guarantee that your application will always be scalable, reliable, and secure.
With PubNub, you can send messages to one or more devices, including smartphones, tablets, desktops, micro-controllers, and more. Just about any device that can connect to the internet can connect to PubNub. These messages can be used to send text-based communication (such as chat), player movements in games, geolocation updates, sensor data, and a lot more.
Try out the Demo App
Animal Forest Chat is a simple, yet feature-rich chat app on PubNub. The app uses PubNub as the messaging infrastructure and framework to connect your chat users.
Click here to open the demo in a new window.
Learn how to build a feature-rich chat application on any platform using the PubNub SDKs.
- One-on-One & Group Channels for private messaging between two users or multiple users in a group.
- Typing Indicators to indicate when a user starts or stops typing.
- Unread Message Counts to show counts of unread messages on chat channels.
- Message History fetches missed messages from storage based on timestamp of the last read message.
- User Online/Offline Status tracks when users join or leave chat channels or shows occupancy of a channel.
- Push Notifications delivers messages via APNS/FCM mobile push services when the app is closed or running in the background.
- Security Controls to encrypt messages or restrict user access to channels.
- Chatbot Integrations built on PubNub's serverless Functions or using third party integrations.
- Content Moderation filters messages based on some of its attributes, so that only messages with acceptable content are passed to subscribing clients.
- Language Translation mutates messages in-flight, altering the final message received by users to be in their requested language.
- External Storage saves your messages to an external database to enable full-text searching, archiving, and more.
Some code and use cases in this documentation require add-on features, which you can enable via the PubNub Admin Dashboard.