I've got a Unity application with Firebase integration, and I'd like to handle the case when I have to shut down the Firebase project for various reasons.
So the application will still function relatively normally, slightly differently.
I tried simulating this by messing up the project_id in the google-services.json.
But it didn't cause any errors, the firebase calls are just aren't executed.
Is there a way to check whether the Firebase initialisation is successful or not?
Yes it is, if you are using Firebase admin SDK on your app you can check it with:
using System;
using System.Threading.Tasks;
using UnityEngine;
using Firebase;
public class FirebaseController : MonoBehaviour
{
public async Task InitializeFirebase()
{
await FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
{
if (task.Result == DependencyStatus.Available)
{
Debug.Log("Firebase correctly Initialized");
}
else
{
Debug.Log("Could not resolve all Firebase dependencies: " + task.Result);
}
});
}
}