This Sample app will guide you to setup Push Notifications in your Ionic application.
- Login to the CometChat Dashboard.
- Select an existing app or create a new one.
- Go to "API & Auth Keys" section and copy the
REST API
key from the "REST API Keys" tab. - Go to the "Extensions" section and Enable the Push Notifications extension.
- Go to the "Installed" tab in the same section and open the settings for this extension and Set the version to
V2
. - Paste the
REST API Key
in the Settings. - Go to Firebase Console and get the Server Key for your app. Paste the Server Key in the settings and click on save.
- Copy your app's
APP_ID
,REGION
andAUTH_KEY
from the Dashboard. These will be required in the next steps.
- Clone this repository.
- Navigate to the
src
directory and replaceAPP_ID
,REGION
andAUTH_KEY
with yours insrc/consts.ts
file. - Go to Firebase Console and get your
google-services.json
andGoogleService-Info.plist
. - Place the
google-services.json
in android/app folder. Place theGoogleService-Info.plist
in ios/App folder. - Install dependencies using
npm install
. - Run the following commands:
ionic build
npx cap sync
npx cap copy
- To run your Android app, execute
npx cap open android
. - To run your iOS app, execute
npx cap open ios
. - Please make sure you have followed all the steps mentioned for the Capacitor Plugin.