cometchat-pro-tutorials / ionic-chat-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to Build an Ionic Chat App

Read the full tutorial here: >> How to Build an Ionic Chat App

Live Demo

This example shows How to Build an Ionic Chat App:

Technology

This demo uses:

  • CometChat
  • Ionic
  • Capacitor
  • Chooser
  • Image Picker
  • Firebase
  • React
  • Uuid
  • Validator

Running the demo

To run the demo follow these steps:

  1. Head to CometChat Pro and create an account
  2. From the dashboard, add a new app called "ionic-chat-app"
  3. Select this newly added app from the list.
  4. From the Quick Start copy the APP_ID, APP_REGION and AUTH_KEY. These will be used later.
  5. Also copy the REST_API_KEY from the API & Auth Key tab.
  6. Navigate to the Users tab, and delete all the default users and groups leaving it clean (very important).
  7. Download the repository here or by running git clone https://github.com/hieptl/ionic-chat-app.git and open it in a code editor.
  8. Head to Firebase and create a new project
  9. Create a file called env in the root folder of your project.
  10. Import and inject your secret keys in the env file containing your CometChat and Firebase in this manner.
REACT_APP_FIREBASE_API_KEY=xxx-xxx-xxx-xxx-xxx-xxx-xxx-xxx
REACT_APP_FIREBASE_AUTH_DOMAIN=xxx-xxx-xxx-xxx-xxx-xxx-xxx-xxx
REACT_APP_FIREBASE_STORAGE_BUCKET=xxx-xxx-xxx-xxx-xxx-xxx-xxx-xxx

REACT_APP_COMETCHAT_APP_ID=xxx-xxx-xxx-xxx-xxx-xxx-xxx-xxx
REACT_APP_COMETCHAT_REGION=xxx-xxx-xxx-xxx-xxx-xxx-xxx-xxx
REACT_APP_COMETCHAT_AUTH_KEY=xxx-xxx-xxx-xxx-xxx-xxx-xxx-xxx
  1. Install capacitor cli with version 2.4.1
npm install -g @capacitor/cli@2.4.1
  1. Install ionic cli
npm install -g @ionic/cli
  1. cd to your root folder and hit npm i to install the packages.
  2. Run the following statement.
cap sync
  1. Run cd to the ios/App folder then run pod install to install the pods. Once pods are installed run cd .. to go back to the root folder.
  2. build the project by running the following statement.
ionic build
  1. Copy the build folder to your native platform
cap copy
  1. Make sure to include .env file in your gitIgnore file from being exposed online.
  2. Run the project by using Android Studio/Xcode. Fore more information you can refer to the Ionic documentation

Questions about running the demo? Open an issue. We're here to help ✌️

Useful links

About


Languages

Language:TypeScript 77.1%Language:CSS 15.5%Language:Swift 4.0%Language:Java 1.7%Language:HTML 1.0%Language:Ruby 0.8%