# Firebase Setup

## Firebase Open

Open this link

{% embed url="https://console.firebase.google.com/" %}

Create a new project by tapping on the **Add Project** box.

<div align="left"><figure><img src="https://content.gitbook.com/content/veo2eEhv0OHMWayjiJ3k/blobs/M6GK2fRqVDNcoZseN4d7/1_tVDrzu5D8Evb35HyvO2AQA.webp" alt=""><figcaption></figcaption></figure></div>

* Enter the **Project name** & select **Analytics location.**\
  **Analytics location** represents the country/region of your organization and sets the currency for revenue reporting.
* Tap on **Create project**. Following this, Firebase will set up a new project for you. This will take just a minute.

<figure><img src="https://content.gitbook.com/content/veo2eEhv0OHMWayjiJ3k/blobs/4EYTSpD7ICMcGzztwWsO/1__1nK-RLLWtr91Pwi9tyj2w.webp" alt=""><figcaption></figcaption></figure>

### Change Firebase Firestore Rules <a href="#fe6c" id="fe6c"></a>

Go to your `firebase firestore`  and change rules.

```javascript
rules_version = '2';

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
      allow update, delete: if request.auth != null;
    }
  }
}
```

<figure><img src="https://content.gitbook.com/content/veo2eEhv0OHMWayjiJ3k/blobs/31KoHDxVWlHGtCmlZBHB/Orban%20Vpn%20-%20Cloud%20Firestore%20-%20Rules%20-%20Firebase%20console%20-%20Google%20Chrome%2021-02-2024%2014_55_14.png" alt=""><figcaption></figcaption></figure>

### Configure an Android app <a href="#fe6c" id="fe6c"></a>

In the **Add an app to get started** section, click on **Android** Icon to add an Android app to Firebase.

<div align="left"><figure><img src="https://content.gitbook.com/content/veo2eEhv0OHMWayjiJ3k/blobs/XQDVTmiGn1ECLQpe3tFV/1_qTSMvlM9KvEW0r8roWZEkw.webp" alt=""><figcaption></figcaption></figure></div>

On the next screen, enter your **Android package name** & **App nickname** and click on **Register App**. Your package name is generally the **`applicationId`** in your app-level **`build.gradle`** file. If specified, the app nickname will be used throughout the Firebase console to represent this app. Nicknames aren’t visible to users.

<div align="left"><figure><img src="https://content.gitbook.com/content/veo2eEhv0OHMWayjiJ3k/blobs/OsxZw49b5Zpyh9egd6Ga/1_NL_b5Z49uUStJkG_u_-d2g.webp" alt="" width="347"><figcaption></figcaption></figure></div>

Download the **`google-services.json`** file & place it in your project’s **`app`** root directory. Make sure the config file is not appended with additional characters, like **`(2)`**.

<div align="left"><figure><img src="https://content.gitbook.com/content/veo2eEhv0OHMWayjiJ3k/blobs/7kIcXc8EpGibs4FiK8qJ/1_I7n6AABk88o1L0sX8qeNnw.webp" alt="" width="375"><figcaption></figcaption></figure></div>

### Configure an iOS app <a href="#ed09" id="ed09"></a>

In the **Add an app to Get Started** section, click on the **iOS** Icon to add an iOS app to Firebase.

<div align="left"><figure><img src="https://content.gitbook.com/content/veo2eEhv0OHMWayjiJ3k/blobs/gZ9KVr0mRnMYPqvYTxMM/1_RYtUIvaz1_jbKwV0mr7RoA.webp" alt=""><figcaption></figcaption></figure></div>

On the next screen, enter your **iOS bundle ID** & **App nickname** and click on **Register App**. You can find your **Bundle Identifier** in the **General** tab for your app’s primary target in Xcode. If specified, the app nickname will be used throughout the Firebase console to represent this app. Nicknames aren’t visible to users.

<div align="left"><figure><img src="https://content.gitbook.com/content/veo2eEhv0OHMWayjiJ3k/blobs/uGIbbOOIHGTbPNDDdypx/1_KfTJuMBQ0HV09YbK00nxXA.webp" alt="" width="350"><figcaption></figcaption></figure></div>

Download the **`GoogleService-Info.plist`** file & move the **`GoogleService-Info.plist`** file you just downloaded into the root of your Xcode project and add it to all targets. Make sure the config file is not appended with additional characters, like **`(2)`**.

<div align="left"><figure><img src="https://content.gitbook.com/content/veo2eEhv0OHMWayjiJ3k/blobs/DjYU1jLa7d79AXpk4c0E/1_1ot2WE8DCWRMq6yu6c26bQ.webp" alt="" width="375"><figcaption></figcaption></figure></div>

Back in the Firebase console-setup workflow, click **Next** to skip the remaining steps.



If you still have any questions please feel free to write to me at puttu0179@gmail.com.
