The loading sequence is different iOS vs macOS.
With iOS, the app delegate didFinishLaunchingWithOptions executes before the mainView controllers viewDidLoad
1) func application(_ application: UIApplication, didFinishLaunchingWithOptions
2) override func viewDidLoad() {
whereas with macOS, the main viewController viewDidLoad executes before the delegate applicationDidFinishLaunching
1) override func viewDidLoad() {
2) func applicationDidFinishLaunching
So yes, it's a timing thing so you need to 'back up' the Firebase initialization.
Often times you start to work with Firebase in viewDidLoad - for example to populate a tableView dataSource, so before that's called Firebase needs to be ready and viewDidLoad seems to work best for macOS apps.
It sure would be cool if Firebase officially supported macOS. ...ehm...