> For the complete documentation index, see [llms.txt](https://lionstudios.gitbook.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lionstudios.gitbook.io/readme/features/remote-configs/firebase.md).

# Firebase

### **Introduction**

Firebase SDK allows developers to:

* Change the behaviour and appearance of the game remotely and do A/B testing. (Firebase Remote Config)
* Get clear, actionable insights into app issues with crash reporting. (Firebase Crashlytics)
* Get insights on app usage and user engagement. (Firebase/Google Analytics)

### **Install Firebase SDK**

* Open the Firebase tab in `LionStudios/Settings Manager` menu
* Click the `“Install Firebase”` button

![](/files/7blTNom7EOOlH4H2KYs3)

* Wait a few seconds for the installation to start

After installation, you can see `Firebase bundle` as “Installed” in Package Manager/My Registry. Firebase bundle has total of four firebase packages dependencies in it i.e,

* Firebase Core
* Firebase Remote config
* Firebase Analytics (aka Google Analytics)
* Firebase Crashlytics

{% hint style="info" %}
**Note:** Please keep only one installation of Firebase either LionStudio one or from following firebase own documentation. If you want to use Firebase SDK from it’s own site then you can skip this step and continue to next step, but first you’ve to install Firebase Core, Remote Config, Analytics and Crashlytics SDK.
{% endhint %}

{% hint style="info" %}
**Note:** After installing Firebase SDK, you will see some errors in the console (such as “Unable to load Firebase app” or “Firebase dependency check failed”). This is normal. Firebase throws these errors on installation because it requires some files to be imported. This will be completed in the next steps.
{% endhint %}

### **Setup**

After installing Firebase SDK, open the Firebase tab in `LionStudios/Settings Manager` . You will find warnings as shown in below image.

![](/files/OEk6jZAYQDSwsAlNXbQ0)

{% hint style="info" %}
To resolve these warnings, Ask your studio manager for Firebase configuration files for Android & iOS.
{% endhint %}

* Use `Browse` button to locate the firebase files. Imported files should be added at the root of Assets folder.

Then:

* For Android, run `Android resolver`.
* For iOS, you don’t have to do anything. If you followed all the steps correctly, the warnings messages will be removed.

![](/files/mXZrchHyKMy8sNlc3a73)

{% hint style="info" %}
**Note:** If `“Setup is Complete”`, doesn’t show up, and instead `“Verify Setup”` shows up, click `“Verify Setup”`. This will check firebase integration once more. If there are some issues, they will be shown in console windows.
{% endhint %}

### Implementation

To use Firebase code, follow these Firebase documentation links for all three Firebase packages for the Unity engine.

* [Firebase Remote Config](https://firebase.google.com/docs/remote-config/get-started?platform=unity)
* [Firebase Crashlytics](https://firebase.google.com/docs/crashlytics/get-started?platform=unity)
* [Firebase Analytics (Google Analytics)](https://firebase.google.com/docs/analytics/unity/start)

Don’t call Firebase functions until Lion Core is initialized. You can ensure it like this:

{% code overflow="wrap" %}

```csharp
void Awake(){    
		if (!LionCore.IsInitialized)    
		{        
				LionCore.OnInitialized += delegate        
				{            
						Debug.Log("Call firebase functions here"); 
				};    
		}
}
```

{% endcode %}

{% hint style="info" %}
If you use a loading scene that waits for Lion Core to be initialized, then you can always call Firebase in the following scenes. See our provided Loading Scene: [Loading Scene](/readme/features/loading-scene.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://lionstudios.gitbook.io/readme/features/remote-configs/firebase.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
