# Enable Cloud Messaging

Pre-requisite(s):

* Firebase project. [Read more..](https://docs.appmachine.com/app-details/firebase/create-firebase-project)

### Enabling Cloud Messaging for your Firebase project

1. Make sure you have selected your **Project** in the Firebase Consol&#x65;**,** and via the cogwheel in the top-left corner of the Firebase console, open **Project Settings**:\
   \
   ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FmWF9EZe8SHHCloFLzDmq%2FDJSTUDIO-bfmYEuhe-1-ry4JyS0d%402x.png?alt=media\&token=f05cfee6-409a-43b0-96f6-5d0c44bb1440)\
   ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FinOAIrVavtzy61YTSn1f%2FDJSTUDIO-pO6sc1J6-1-tT3XKNlB%402x.png?alt=media\&token=7963d4b3-9e03-4aa2-976e-82487001d918)
2. Open the **Cloud Messaging** settings page by clicking on the similarly named tab. Then click on the three dots in the upper right corner. Select **Manage API in Google Cloud Console**.\
   \
   ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FaI7XttyOccbQRJxKBu3s%2FDJSTUDIO-8MiJsVdG-1-TKl2z71G%402x.png?alt=media\&token=a3ddf281-9125-4674-9622-f99ddaa35acf)\
   ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FgaZmIgZRWmLnXpGFHkRq%2FDJSTUDIO-ePDD1iPy-1-7gXUCL5D%402x.png?alt=media\&token=6f83a270-203f-4275-b2d8-965d93c4d0d1)
3. We want to manage our Firebase Cloud Messaging API account, so select **Manage**:\
   ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FCqjSX2M8bOZpKqMBQGPW%2FDJSTUDIO-FwQfzdXz-1-Z4sEgFcm%402x.png?alt=media\&token=e21da22e-7a9b-4840-b9b8-b022310839ca)
4. You'll be redirected to the **Google Cloud Console** in a new tab. Here we are going to create a new service account:\
   \
   1\) Select **Credentials**\
   2\) Select **Create Credentials**\
   3\) Select **Service Account**\
   ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FM4oyWjiyGaFQwqFma1DW%2FDJSTUDIO-ghlx6pnc-1-8JBqzlSV%402x.png?alt=media\&token=3f9dbe70-5d39-4c3a-99b0-824e4e1990fe)
5. Give the account a name (you are free to choose) and select **Create and** **Continue**:\
   ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2F8jUcQWj56H7uYOzb4RIA%2FDJSTUDIO-BZyBPdz0-1-NWJRcrAu%402x.png?alt=media\&token=9b752316-9c0d-4076-87d9-fb519ccd2147)&#x20;
6. Continue with assigning the role **Firebase Cloud Messaging API Admin** to this new account:\
   ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2F6VG1BMLSvW3frzby1r2L%2Fimage.png?alt=media\&token=fe51d30a-b3a4-4551-9f6b-385be67074e4)<br>
7. Select **Continue** and then **Done**:<br>
8. We are now ready to start **creating the keys** that we need to upload in AppMachine. Back in the main overview, select the account you just created by clicking on it:\
   ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FsbrzdWw9KTZ0zi3rgafB%2FDJSTUDIO-b8rl4Po0-1-Rt3ws6AZ%402x.png?alt=media\&token=026cc378-6d69-43e1-98c2-a094110069d8)
9. Here, select **Key** and then **Add Key**:\
   ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2F0t3NlynhvQnnvxz6bKVC%2FDJSTUDIO-4WxWaf6P-1-Q1Q39fLd%402x.png?alt=media\&token=36a08351-ad5b-4895-b3d0-a1ad01e199f8)
10. Select **Create new Key**, then select **JSON** and finally click **Create**:\
    ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2Fvjz8VWT5yh2xBxPhEHtE%2FDJSTUDIO-MrbBWjEv-1-TRsFWZ3r%402x.png?alt=media\&token=2f7906b6-32e2-4e7d-a2ca-3a88cfcebbbc)\
    ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2F1Y2Bv0KavFNR2OwiVsYO%2FDJSTUDIO-DvpF5p3S-1-CWYx9nMP%402x.png?alt=media\&token=3ee88de5-da02-48b1-81bb-786da6045dc6)
11. You will now see a confirmation that the key has been created and downloaded to your computer:\
    ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FxElAc4wYq7MLDqbQUMRT%2FDJSTUDIO-wEZ57qfE-1-tosdCM5p%402x.png?alt=media\&token=47b71b08-1aa0-4815-8b19-d51dc79fe383)
12. We are done here, and return to the AppMachine Designer:\
    \
    1\) Go the the **Publish** page of your app\
    2\) Select **Edit Store Info** \
    3\) Select **View Certificates and API Keys**\
    \
    ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FynWGtYv29sO20lkYY54Z%2FDJSTUDIO-KJUycBRI-1-Olrp8ihE%402x.png?alt=media\&token=348b84d0-1229-4f88-9b93-6aeb140a8af0)
13. Select **Add Certificate**:\
    ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FDbVaXMjoCrzEHPfQsNSr%2FDJSTUDIO-EFcIztKW-1-nzcPCxR4%402x.png?alt=media\&token=02888eb1-4172-406d-bdd7-d4bbfba66eaa)
14. Click on **Next**:\
    ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FU63kot5zVsrzSMVCb5nV%2FDJSTUDIO-auELjTG7-1-cxctTmwH%402x.png?alt=media\&token=9f6a3f55-a4fb-4dc5-b6d8-dc2ae72c9cdb)
15. **NOTE:** Make sure you start with the google-services.json, this is the file you downloaded when you first created your app project. If you don't have it, you can re-download it through the **Project Settings** of your app:\
    ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FgnGiJzD80UeyK2JzOfLH%2Fproject.png?alt=media\&token=02b64979-dc1c-427b-a115-263dbdbfc0da)<br>
16. After uploading google-services.json, you can proceed to upload the newly created key. When you are ready, select "Upload".\
    ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FAFWUowi6rxB4sUZmqUBb%2FDJSTUDIO-o48Jji8E-1-Xs7hR6ku%402x.png?alt=media\&token=43682c12-bd77-4dc0-9dea-d98fe331ce94)\
    ![](https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2Fbrbj62wFaAcHKfUgQjva%2FDJSTUDIO-YmLYLRdc-1-qSyuKpv7%402x.png?alt=media\&token=f3c47ed2-d379-4936-85b1-640bdd4cafe8)
17. Congratulations, you are now finished! &#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appmachine.com/app-details/firebase/enable-cloud-messaging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
