# Firebase Configuration

After Change package name now you need to config the firebase (firebase its a google service used to send notification and to allow the application login with google accounts)

## Setup Firebase project <a href="#d4bb" id="d4bb"></a>

To create a new Firebase project you will need to go [here](https://console.firebase.google.com/).

1. Click on “***Add project***” to create a new project.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFyma-W7erawEsJcEJj%2F-MFyo8o_6ackaN-cZgbt%2F1_OdkcPjoktutZQVKShV2owQ.png?alt=media\&token=56ff3e94-6271-4562-8cfd-0e6ba69e0420)

**2.** Now, you have to enter a “***Project name***” and check the two checkboxes below. Then, click on “***Create project***”.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFyma-W7erawEsJcEJj%2F-MFyoZSSRsernVnmeogP%2F1_QRs5KwGQI1KN51mwq8hBAw.png?alt=media\&token=3a589088-2012-4c60-84e4-96a7a9761da4)

**3.** Now, wait for the creation to complete and click on “***Continue***”.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFyoasecAnazu8cair-%2F-MFyom0pU50gnWWuUCvu%2F1_4zQItwTcBQKyWGeBM84Bwg.png?alt=media\&token=4acfec90-a25a-4486-a39e-17cdcb66dda3)

**4.** This will lead you to the “***Project Overview***”. From here you will be able to add **Firebase** to your **Flutter** project.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFyoasecAnazu8cair-%2F-MFypBDd3MfHIIHru3LT%2F1_XO49PoKRvZbw_030W3Rv5A.png?alt=media\&token=327d5ff7-1df1-4420-b6e6-9f4e489564f8)

5\. Click on the **Android icon**.&#x20;

In this form, you have to first enter the “***Android Package name***”. You can get the android package name form your **project directory** → **android** → **app** → **src** → **AndroidManifest.xml**. On the second line, there will be your package name. Just copy & paste in the form.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFypGKuMcvVyMCpgdc_%2F-MFyq6mThGXpmWgCNwRd%2F1_WI0NRLns3nD5YMHfe92Nsg.png?alt=media\&token=a25b0a79-e5db-4839-902e-17f47ff73857)

4\. Now, you have to enter the “***SHA-1 hash***”. Just hover over the help (?) and click on ***See this page***. This will take you to “***Authenticating Your Client***” page.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFypGKuMcvVyMCpgdc_%2F-MFyqUeu9_ztWYjjyhBY%2F1_JOtKnV4oP9JpHa5YrXWvZg.png?alt=media\&token=24302dd5-97d4-4373-bb34-92eb5ce92c1e)

From here you will get the command to generate the SHA-1 hash. Paste this in your ***IDE terminal*** to get the SHA-1 hash. Just copy & paste this in the form.

5\. Click on ***Register App***.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFypGKuMcvVyMCpgdc_%2F-MFypr7Soj9MMV3f_-bR%2F1_rfKXvpLIXNNRjxv3VMDpyg.png?alt=media\&token=fd40dc34-316e-433c-b486-5a1d42caa3d9)

6\. This will take you to the second step from where you can download the “***google-services.json***” file and just drag & drop it in your **project directory** → **android → app**. Then, click on **Next**.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFypGKuMcvVyMCpgdc_%2F-MFyqpWR18S-F7hlYhPt%2F1_KMBk8yQHY85JiAlhfaeXKQ.png?alt=media\&token=7e4acc1b-4349-4b08-9e5c-0a846a65f7dd)

7\. In the third step just follow the instructions add the ***code snippets*** accordingly in the desired position. Then, click on **Next**.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFypGKuMcvVyMCpgdc_%2F-MFyr-ZDSxVgXig7HNYT%2F1_pplCKi-x3SlPg7y0Uyelng.png?alt=media\&token=dc1047c0-b6c9-4b5c-a537-d44e90e2eed5)

8\. Finally, to complete the fourth step just **run the app** on your device and **attempt a google sign in** from the device for the first time.

> *Make sure that the internet connection of the device is turned on*.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFyr5thgPc8VSxHC2FD%2F-MFyrK2PtNrs3RZwTgPz%2F1_dxW3htcVjSe4oEu_WXqKZA.png?alt=media\&token=58b7b272-40aa-4a85-8a98-95a2a5609013)

9\. After completing this step, you will see that the “***Continue to Console***” button gets enabled and click on it to go to the console of the app.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFyr5thgPc8VSxHC2FD%2F-MFyrbQxFxkUA4dTvmRe%2F1_0Jvp071Eei-rq3KzfrKrVA.png?alt=media\&token=e45e9e99-8800-4e4d-a9c3-29ea284e8547)

1. Go to **Authentication Page** → **Users** tab and click on “***Set up sign-in method***”.

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFyzSIY5hfRrj8ord_M%2F-MFz0L_qSfUCZazptRt5%2Fscreenshot.png?alt=media\&token=054ca264-5aea-4b63-83a0-a779132b30c1)

2\. Go to **Cloud Firestore** → click on “**Create database**".

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFyzSIY5hfRrj8ord_M%2F-MFz3XEcMIxT0GIJ0Oqx%2Fscreenshot_1.png?alt=media\&token=e9d939a8-228a-4ae4-ba56-0b4543c635ab)

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFyzSIY5hfRrj8ord_M%2F-MFz3eVxPismHkVNkZXb%2Fscreenshot_2.png?alt=media\&token=eb3cd4f4-4394-45b2-90cd-1845d73a4784)

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFyzSIY5hfRrj8ord_M%2F-MFz3kZbGhUbrBfA9BIS%2Fscreenshot_3.png?alt=media\&token=8d9f4c2e-ec2c-4a81-9afb-80a253090f44)

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFyzSIY5hfRrj8ord_M%2F-MFz3pLXBdYaLRXkGdbk%2Fscreenshot_4.png?alt=media\&token=717eee7d-644a-4a81-add0-c66cf88516ce)

<br>
