# Firebase Configuration

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FuLA4nXKT4iYwrY3J2Qxh%2FScreenshot%202023-12-07%20at%2011.14.43.png?alt=media&#x26;token=873e7ca9-c95c-4538-bacd-5030307e7438" alt=""><figcaption><p>Upload the Firebase files from Firebase Config</p></figcaption></figure>

## Requirements:

* A Firebase project
* Configuration files for each platform:
  * Android: google-services.json
  * iOS: GoogleService-Info.plist

## 1. Create your Firebase project

1\. Log in or create a Firebase account in the [Firebase Console](https://console.firebase.google.com/).&#x20;

![](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZe02rwYx00uu387%2FScreenshot_2020-10-08_at_15.45.53.png?generation=1629274918743234\&alt=media)

2\. Once in the Firebase Console, **create a new project** or **select an existing project** you want to use.

3\. If creating a new project, first fill in a project name.

![](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZe1fN87_MU315lo%2FScreenshot_2020-10-08_at_15.49.56.png?generation=1629274918733868\&alt=media)

4\. Next, choose if you want Google Analytics support. If you do, keep it enabled (it's optional). You will need to link it to a Google Analytics account in the 3rd step. If not, disable it.

5\. Finally, we create the project, it takes some seconds.

![](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZe2HiTbKeEVniOI%2FScreenshot_2020-10-08_at_15.53.44.png?generation=1629274918596597\&alt=media)

Now, you need to **obtain the Firebase configuration files** (**GoogleService-Info.plist for iOS** and **google-services.json for Android)** and upload them to Bravo.

The purpose of this configuration file is to **create a link between our app and this Firebase project**.  So, if in the future, you want to connect to another Firebase project, you can do it by uploading a new Firebase configuration file in Bravo for each mobile platform (iOS and Android).&#x20;

Depending on your needs, you can either:

* Set up your Firebase Login for Bravo Vision (recommended for prototyping and testing)
* Set up your Firebase Login for your live or published app (recommended for publishers)

In case you want to configure both Bravo Vision and live app for iOS and Android, you will need 4 files in total:

1. **GoogleService-Info.plist for iOS Bravo Vision**
2. **google-services.json for Android Bravo Vision**
3. **GoogleService-Info.plist for iOS published app**
4. **google-services.json for Android published app**

## **2. Firebase Services for Bravo Vision**

Follow these steps to obtain the configuration files for Bravo Vision:

### 2.1.  Create an app and download the Config files for Bravo Vision

If you don't have any app created in Firebase yet, follow the next steps as **you need to create new Firebase configuration** **files** to upload them to Bravo Studio.&#x20;

1. Scroll down to **Your apps** section and click **Add app**.
2. **Choose a platform** (iOS or Android) and do the following depending on the platform:

{% tabs %}
{% tab title="IOS" %}

1. Go to **Project Overview** (from the left menu), click the **iOS symbol.**

![First step to create your app for IOS](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZe-lalbD1_cPadK%2Ffirebase8.gif?generation=1629274918818351\&alt=media)

2. In **Step 1**, fill in the **iOS Bundle ID** for Bravo Vision with <mark style="color:red;">`com.codelesslabs.app`</mark> Leave the rest blank, and click **Register app**.

![Register app with iOS bundle ID "com.codelesslabs.app"](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZe4PMCTqr0fNRny%2FScreenshot_2020-10-08_at_16.24.49.png?generation=1629274918592048\&alt=media)

2. In **Step 2**, **download** the file **GoogleService-Info.plist** and click **Next.**

![Download GoogleService-Info.plist](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZdvKvKR7p7p2aJq%2Ffirebase11.png?generation=1629274918518820\&alt=media)

3. The rest of the steps are not needed, so click **Next** for Steps 3 and 4.&#x20;
4. To finish, in **Step 5**, click **Continue to the console.**
5. To verify that the app has been created, go to your **Project Overview > General > Your apps.**
   {% endtab %}

{% tab title="Android" %}

1. Go to **Project Overview** (from the left menu), click the **Android symbol** or **Add an app.**

![](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZdwp1oe4FlfpEDN%2Ffirebase13.png?generation=1629274918589308\&alt=media)

2. In **Step 1**, fill in the **Android package name** for Bravo Vision with <mark style="color:red;">`com.appfoundry.previewer`</mark>. Leave the rest blank, and click **Register app**.

![Register app with Android package name "com.appfoundry.previewer"](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZe57jRIQKWrNGdW%2FScreenshot_2020-10-08_at_16.45.06.png?generation=1629274918605131\&alt=media)

3. In **Step 2**, **download** the file **google-services.json** and click, **Next.**

![How to download the google-services.json](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZdxXXqMA4FHjsso%2Ffirebase14.png?generation=1629274918526621\&alt=media)

3. The rest of the steps are not needed, so click **Next** for Steps 3 and 4.&#x20;
4. To finish, in **Step 5**, click **Continue to the console.**
5. To verify that the app has been created, go to your **Project Overview > General > Your apps.**
   {% endtab %}
   {% endtabs %}

### 2.2 Upload the Firebase Config files in Bravo

1. Once having the Firebase configuration files, **go back to Bravo Studio,** select the **App > Integrations tab > Firebase Config.**\
   \
   If you're setting up the Firebase Configuration to manage user authentication, select the **App > Integrations tab > Login > Enable Firebase Email/Password & Social Login.**&#x20;

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2F6iJqjtI07gbIa06D3poG%2FScreenshot%202024-01-04%20at%2016.36.28.png?alt=media&#x26;token=651a2c85-ce3e-4897-a1c8-b90d84bc704e" alt=""><figcaption></figcaption></figure>

2. Under "**Activate Firebase services for Bravo Vision**", upload the Firebase files in the corresponding fields.&#x20;

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FuLA4nXKT4iYwrY3J2Qxh%2FScreenshot%202023-12-07%20at%2011.14.43.png?alt=media&#x26;token=873e7ca9-c95c-4538-bacd-5030307e7438" alt=""><figcaption><p>Upload the Firebase files from Firebase Config</p></figcaption></figure>

![google-services.json and GoogleService-Info.plist for Bravo Vision uploaded in Firebase Config](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FgXC4BkZrV2BJ4LD9HH8y%2FScreenshot%202023-12-07%20at%2011.16.04.png?alt=media\&token=20fc9f90-ab09-4491-b688-395f5523a21c)

3. After uploading the files, do not forget to **Save** the changes. Then, your Firebase configuration for Bravo Vision is completed!&#x20;

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FtVEKwNI2EcEGpdUO5kFo%2FScreenshot%202023-12-07%20at%2011.26.18.png?alt=media&#x26;token=6f410982-f6d4-452c-8499-d8915d54085d" alt=""><figcaption><p>Completed Firebase Config files for Android and IOS</p></figcaption></figure>

{% hint style="info" %}
You must have a green check :white\_check\_mark: in order for that integration to work correctly on that platform you're setting up. If you're not setting up Firebase in a certain platform, you can ignore the warning icon.
{% endhint %}

## 3. Firebase Services for published app

Once you are ready to publish your app to the stores, **you need to create new Firebase configuration** files with the final bundle ID (for iOS) and package name (for Android) and upload them to Bravo Studio.

![](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZdpKH4f4WfIGHe2%2Ffirebase-bravo4.png?generation=1629274918528211\&alt=media)

### 3.1. Create an app and download the Config files for your live app

If you don't have any app created in Firebase yet, follow the next steps as **you need to create new Firebase configuration** files with the final bundle ID (for iOS) and package name (for Android) and upload them to Bravo Studio. Otherwise, add the missing params we mention:

1. Scroll down to **Your apps** section and click **Add app**.
2. Select a platform: iOS or Android.
3. Register the app and do the following depending on the platform:

{% tabs %}
{% tab title="IOS" %}

1. Enter your <mark style="color:red;">**`Bundle ID`**</mark> and <mark style="color:red;">**`App Store ID`**</mark>. Remember you need to complete [step 2 of the publishing process](https://docs.bravostudio.app/app-publication/publishing-your-app/ios-publication-complete-process/generate-certificates-appids-and-provisions) to have these parameters ready.

**Where do I find the final Bundle ID (for iOS)?**

When you have the necessary files for publication, use the same **Bundle ID** from the Bravo publication form for the final Firebase file. (Check how to [set up the Bundle ID](https://docs.bravostudio.app/app-publication/publishing-your-app/ios-publication-complete-process) on the app publication process)

![](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZdoVqpOMWLn5ido%2Ffirebase-bravo3.png?generation=1629274918607348\&alt=media)
{% endtab %}

{% tab title="Android" %}

1. Enter your <mark style="color:red;">**`Android Package`**</mark> name. Remember you need to [have completed steps 1 and 4](https://docs.bravostudio.app/app-publication/publishing-your-app/android-publication-complete-process) of the Android publishing process to have these parameters ready.

**Where do I find the final package name (for Android)?**

In the Publish tab of your app project, go to **Android** > **Publication**.&#x20;

![](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MhNKqDur4tQGJPUgzbJ%2F-MhNLZdnCafii38jMelj%2Ffirebase-bravo2.png?generation=1629274918581053\&alt=media)
{% endtab %}
{% endtabs %}

### **3.2.** Upload the Firebase Config files in Bravo

1. Once having the Firebase configuration files, **go back to Bravo Studio,** select the **App > Integrations tab > Firebase Config.**
2. Under **"Activate Firebase services for final app",** upload the Firebase files in the corresponding fields and do not forget to **Save** the changes.&#x20;

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FluWn05K0kuqefk4bIZsI%2FScreenshot%202023-12-12%20at%2011.40.35.png?alt=media&#x26;token=8680c29d-8337-48e9-90e0-3b1ec398ed65" alt=""><figcaption></figcaption></figure>

3. Firebase integration has been updated in this app. Please request a new build and upload a new version to ensure your published app continues to work properly.

{% hint style="warning" %}
In case you already have a published app bundle, and you change these Firebase assets, you'll need to generate a new bundle and publish an update to the stores.
{% endhint %}
