# Push Notification

We provide 2 providers to send notification messages : **FCM** and **OneSignal**, FCM configuration is required and has been explained in the previous step by replacing google-services.json with yours, then OneSignal setup is optional.

### **FIREBASE CLOUD MESSAING (FCM)**

**Server Key**

Firebase provides Server API Key to identify your firebase app. To obtain your Server API Key, go to firebase console, select the project and go to settings, select Cloud Messaging tab and copy your Server key.

<div align="left"><img src="https://3806645249-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LfFYEy1XrsDMlbIHLW7%2Fuploads%2FFviCwMuJREFExU98GClh%2Fimage.png?alt=media&#x26;token=3f97178d-4637-4c62-a2d9-b2dc84fc97de" alt=""></div>

**FCM Notification Topic**

* In the latest updated version starting from version 4.0 or higher, notifications are received based on subscribed topics, so, the FCM token will not be stored in the database and no longer used.
* Notification topic name is determined by you, the notification topic must be written in lowercase without space (use underscore), e.g : android\_ebook\_app\_topic

Login to your Admin Panel, navigate to Settings menu and put your **FCM Server Key and FCM Notification Topic**.

<div align="left"><img src="https://3806645249-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LfFYEy1XrsDMlbIHLW7%2Fuploads%2FQCpuw72mVmwJQeh3RScw%2Fimage.png?alt=media&#x26;token=390765fd-5c00-4396-a899-1b84a3b5abd8" alt=""></div>

### **ONESIGNAL**

**Required For Setup**

* A [**OneSignal Account**](https://onesignal.com/), if you do not already have one
* Your OneSignal App ID, available in [**Keys & IDs**](https://documentation.onesignal.com/docs/accounts-and-keys#section-app-id)​
* ​[**A Google/Firebase Server API Key**](https://documentation.onesignal.com/docs/generate-a-google-server-api-key)​
* A device or emulator that has Google Play services installed and updated on it (Device will not subscribe or receive push notifications with out this).

**Keys & IDs Setup**

* Login to your OneSignal Account and select your app
* Select **SETTINGS > Keys & IDs** to get your OneSignal APP ID and REST API KEY
* Login to your Admin Panel, navigate to Settings menu and put your **OneSignal APP ID** and **OneSignal REST API KEY**.

<div align="left"><img src="https://3806645249-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LfFYEy1XrsDMlbIHLW7%2Fuploads%2FBmIlApq6PKPVVGkqhA5q%2Fimage.png?alt=media&#x26;token=836f04e8-f032-4085-8ff3-b2d23f1846d4" alt=""></div>

<div align="left"><img src="https://3806645249-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LfFYEy1XrsDMlbIHLW7%2Fuploads%2FpRfEj0RLreLbjOK1zvKY%2Fimage.png?alt=media&#x26;token=797085d7-64fa-4332-90a8-d41a686e87ca" alt=""></div>
