---
description: >-
  A push notification is an automated message that is sent to the user by the
  server of the app that’s working in the background (i.e., not open.)
---

# Push Notifications For CMS

### Push Notifications

Goto: [https://firebase.google.com](https://firebase.google.com/docs/cloud-messaging/ios/certs)

**Step 1 :Create a Firebase App**

First, you should create a free Firebase account and create a new project there. You can visit [firebase.google.com](https://firebase.google.com) and signup if you don't have an account with Google earlier, and if you have an account, you can create a firebase app project. You can enter the project Name and Select Region, and it will create a Firebase project for you.

Once the project gets Created, Navigate into Overview menu on the left side there you can see project overview and under that click on project settings there you have to click on cloud messaging you will get server key and sender ID as displayed in the below screenshot



![](https://866764004-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQkw2f2E4Uplg25YDMw%2F-MQld5sXC6YCHnxf0pFw%2F-MQldLQM-3OpB0F_oOru%2Fpush%201%20new.jpg?alt=media\&token=54422d2c-fcb2-4a9f-b93c-d2895ce17bf2)

**Step 2 :**&#x20;

Goto [https://onesignal.com/](https://onesignal.com/). Create account or log in if you are already a registered user. Then click on 'Add New App' on the screen window. Enter app name and organisation name and click on add app as shown in the screenshot below&#x20;

![](https://866764004-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQkw2f2E4Uplg25YDMw%2F-MQld5sXC6YCHnxf0pFw%2F-MQldOvw6ZjejfbRylc-%2Fpush%205%20new.jpg?alt=media\&token=b717ab56-b6e3-4e97-b1b1-8481969cf1c8)

It will navigate to the page and asks you to select the platform ,select the platform (google android ) click on next

![](https://866764004-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQkw2f2E4Uplg25YDMw%2F-MQld5sXC6YCHnxf0pFw%2F-MQldStOskMD4_TJNo2F%2Fpush%207%20new.jpg?alt=media\&token=e9eb44be-c3a4-43f7-8164-28bf27ccd3c6)

&#x20;there you find the fields to enter Firebase server key and firebase server ID here you need to paste the server key and ID that you got from Step 1 and click on save as displayed in the screenshot below.

![](https://866764004-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQkw2f2E4Uplg25YDMw%2F-MQld5sXC6YCHnxf0pFw%2F-MQldYfdzTMp5_7PYhYL%2Fpush%202%20new.jpg?alt=media\&token=414a7e13-205e-4f77-aab9-8eb0a79d170a)

**Step 3 :**&#x20;

In onesignal.com after creating the project click on the project then settings >Key and ID's copy this one signal APP ID and rest API key shown in the screenshot given below

![](https://866764004-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQkw2f2E4Uplg25YDMw%2F-MQld5sXC6YCHnxf0pFw%2F-MQldafn7ESF6t6-6f_m%2Fpush%203%20new.jpg?alt=media\&token=6c8ba7c6-9b7b-4e41-ad45-f767ee30c4b6)

**Step 4 :Replace Server key and sender ID in your Project folder**&#x20;

Navigate to the project folder there on the left-hand side go to **src>app>routes>restaurant >push notification>push-notification.component.ts**&#x20;

There you can replace the **app Id** and then below that navigate to the folder **push-notification.service.ts** you can paste the **rest API key** that you received.

The above steps is to send push notifications for all the users .
