Skip to content

[🐛] Bug Report Title - FirebaseApp.configure() not working in React Native 0.79.1 AppDelegate.swift using New Architecture #8506

Open
@Spero-Sourabh

Description

@Spero-Sourabh

I'm trying to configure Firebase in a React Native 0.79.1 app using the new architecture. The AppDelegate.swift file format has changed in RN 0.79+, and FirebaseApp.configure() does not seem to initialize Firebase properly when added to this file.

Environment:

React Native version: 0.79.1

Firebase module: @react-native-firebase/app (or whatever module you're using)

macOS version:15.2

Xcode version: 16.0

Cocoapods version: 1.16.2

iOS deployment target: ios 18

Steps to reproduce:

Install Firebase via CocoaPods.

Add FirebaseApp.configure() to AppDelegate.swift.

Run the app using yarn ios.

Expected behavior: Firebase should initialize successfully without errors.

Actual behavior: Firebase is not initialized, or no logs confirm that FirebaseApp.configure() ran successfully. Sometimes other Firebase modules throw "not configured" errors.

AppDelegate.swift Code:

import UIKit
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider
import FirebaseCore

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
  var window: UIWindow?

  var reactNativeDelegate: ReactNativeDelegate?
  var reactNativeFactory: RCTReactNativeFactory?

  func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
  ) -> Bool {

    FirebaseApp.configure()

    let delegate = ReactNativeDelegate()
    let factory = RCTReactNativeFactory(delegate: delegate)
    delegate.dependencyProvider = RCTAppDependencyProvider()

    reactNativeDelegate = delegate
    reactNativeFactory = factory

    window = UIWindow(frame: UIScreen.main.bounds)

    factory.startReactNative(
      withModuleName: "skyzone",
      in: window,
      launchOptions: launchOptions
    )

    return true
  }
}

Additional context: I've verified the GoogleService-Info.plist file is added to the correct target. I’ve also confirmed that Firebase is installed via pod install. No compile-time errors are present, but Firebase is not functioning as expected.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions