By the end of this tutorial, you will have a simple mobile chat app that allows multiple users to exchange messages in a chat room. When you open the app, you’ll choose an emoji avatar that will represent your user and then you’ll go straight into a chat room to start chatting.
Download the code
You can get the full source code from GitHub.
Node.js (10+). Make sure that you have a recent version of Node installed. If you aren't sure, just type into your terminal
Expo. This tool allows you to quickly prototype a React Native app and test it immediately on your phone (similar to Create React App). The following command installs the Expo CLI application used to bootstrap and run React Native projects.
PubNub Account - to run this app you must create an account with PubNub and obtain your publish and subscribe keys. If you don't already have an account, you can create one for free.
Run the project
Follow the instructions below to run the app in your local environment.
Clone the GitHub repository.
Navigate to the root directory.
Install npm dependencies.
subscribeKeyfor your app in
Start the dev server.
Open http://localhost:3000 to view the application in your browser if it doesn't open automatically. When you're done, type Control-C in your terminal window to stop the web server.