- Home /
Firebase initialization takes too long
I have Firebase in my application. My problem is that it loads for at least 2 seconds on my test device on the first LogEvent call, when it initializes. Unfortunately the initialization is synchronous. I tried creating a loading screen and call a LogEvent method on my main menu that loads asynchronously, but it didn't work, because the loading screen freezes while Firebase initializes. I have no idea how I should initialize Firebase so it doesn't freeze my application for a few seconds on it's first call... Any suggestions?
Answer by sparkzbarca · Jan 21, 2018 at 05:48 AM
Umm, the simplest solution seems to be to just load a static image and display that for two seconds.
Though if you want to try to load have you tried using a co routine so you dump the loading screen on another processor? Or call firebase itself on a co-routine so it tries to load on a second one.
Answer by DavidSWu · Jun 18, 2018 at 07:18 AM
We overlap the initialization with our main scene load. We start with a loading scene that kicks off the main scene load, waits a frame and then initializes firebase We make sure that no Firebase calls occur before then.
Hope that helps!