# 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/RTIkM7mLrmv2QWvtQw9Y/blobs/4Li5PbBiVbtM7GPaYmvx/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/RTIkM7mLrmv2QWvtQw9Y/blobs/dKqLvwtDR44Onuj4TjCN/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/RTIkM7mLrmv2QWvtQw9Y/blobs/lt6Wl4SCYOabQCL9FCGq/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/RTIkM7mLrmv2QWvtQw9Y/blobs/bPsyQ0OSxLgXwcLF7lkm/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/RTIkM7mLrmv2QWvtQw9Y/blobs/rAfiZWIgHqcaBcdwcCkw/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/RTIkM7mLrmv2QWvtQw9Y/blobs/NLke3ydqS6cXSc7AqYPB/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/RTIkM7mLrmv2QWvtQw9Y/blobs/hR2j28dsLzY06F4fMaz5/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/RTIkM7mLrmv2QWvtQw9Y/blobs/slv8149A13qaWw3kT4fN/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/RTIkM7mLrmv2QWvtQw9Y/blobs/d5LBSUatFZGkVGAu5rt1/1_1ot2WE8DCWRMq6yu6c26bQ.webp" alt="" width="375"><figcaption></figcaption></figure></div>

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

### Enable Authentication. <a href="#ddc8" id="ddc8"></a>

On your console, first, go to the project that you created. Now, go to `Authentication` tab from the right panel and you will be able to see a button for `Get Started` .

<figure><img src="https://miro.medium.com/v2/resize:fit:901/1*MruFGHlIGhSVvGzrKZG01Q.png" alt="" height="421" width="700"><figcaption></figcaption></figure>

Now, click on the button and then you will see a list of authentication providers which we can use in our application.

<figure><img src="https://miro.medium.com/v2/resize:fit:901/1*Vu7fHfj-xdnTkLG-pBhH_Q.png" alt="" height="414" width="700"><figcaption></figcaption></figure>

Now, click on `Email/Password` and enable it. Once you enable it, you will see `Enabled` besides Email/Password Provider.

Now, click on Google and enable it. Once you enable it, you will see Enabled besides Google Provider, and then click on Apple and enable it. Once you enable it, you will see Enabled besides Apple Provider



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