Skip to content

[📚] New setup guide for iOS Credentials in RN 0.77 #8248

Closed

Description

@jordankkk

Starting with RN 0.77 /ios/{projectName}/AppDelegate.mm is removed and changed to AppDelegate.swift


Image

Activity

  1. mikehardy commented on Jan 24, 2025

    @mikehardy
    Collaborator

    Hi there - please just hit the edit button top right of the page and propose a change

  2. jordankkk commented on Jan 24, 2025

    @jordankkk
    Author

    @mikehardy I apologize, as I’m new to React Native and am unsure how to make the change. 😁

  3. romanakash commented on Jan 25, 2025

    @romanakash

    Created a PR here #8251

  4. tahaipek commented on Jan 29, 2025

    @tahaipek

    Thank you for your guidance and PR.

    Similarly, do you have a guide to enable Multidex on Swift?
    https://rnfirebase.io/enabling-multidex#enabling-multidex

    Similarly, do you have a guide to configure Cloud Messaging in Swift?
    https://rnfirebase.io/messaging/usage#background-application-state

    Or was the problem solved from a more fundamental point in RN 0.77? I couldn't find any documentation on this.

    I noticed that the documentation of rnfirebase.io is old.

    I'm currently trying to update ReactNative 0.72 to 0.77, so I need to adapt many packages back to 0.77.

  5. mikehardy commented on Jan 29, 2025

    @mikehardy
    Collaborator

    @tahaipek 👋

    The documentation on rnfirebase.io is as new as we have it, if there is something out of date there is an edit button top right of every page and the github PR flow in their web UI for text changes is trivial. I imagine since you mention react-native 0.77 you have noticed that react-native now uses AppDelegate.swift vs .mm. Please feel free to post a PR

    Multidex was a workaround for old Android devices that are no longer supported, and we may all happily forget about multidex forever. And you never ever needed to think about it for iOS, it was an Android thing. You will never need it with modern Android.

  6. tahaipek commented on Jan 29, 2025

    @tahaipek

    Hi,
    I think I will reach the solution a little late because I don't have technical knowledge about Native Android (kotlin) and iOS (swift) development. If I reach the solution, I will definitely update the docs and create PR.

    • I will skip the Multidex state. Thank you for your technical guidance.
    • I wonder if you can give some guidance for the “Background Application State” state?

    Thanks in advance for your advice.

  7. MezillaJohn commented on Feb 9, 2025

    @MezillaJohn

    Hi there - please just hit the edit button top right of the page and propose a change

    Please can you guys update this and the docs as soon as possible, cause we are stuck here.

  8. vishalksymentix commented on Feb 11, 2025

    @vishalksymentix

    This is the updated Doc of react native 0.77 with firebase. How can you modify appdelegate.swift to integrate the firebase

    use this to import firebase

    import Firebase

    use this to initialize firebase
    FirebaseApp.configure()

  9. AnmolMalik-BWES commented on Feb 11, 2025

    @AnmolMalik-BWES

    App started crashing after FirebaseApp.configure()

    "@react-native-firebase/app": "^21.7.2",
    "@react-native-firebase/messaging": "^21.7.2",
    "react-native": "^0.77.0",

    Do I also need to change Podfile

  10. vishalksymentix commented on Feb 12, 2025

    @vishalksymentix

    App started crashing after FirebaseApp.configure()

    "@react-native-firebase/app": "^21.7.2", "@react-native-firebase/messaging": "^21.7.2", "react-native": "^0.77.0",

    Do I also need to change Podfile

    Please mention your podfile here

  11. AnmolMalik-BWES commented on Feb 12, 2025

    @AnmolMalik-BWES
  12. BrahmbhattOm commented on Feb 14, 2025

    @BrahmbhattOm

    @AnmolMalik-BWES, After some digging I achieved it and made a guide on the medium for the react-native 0.77 I hope it helps https://medium.com/@ompbarot9816/firebase-and-google-maps-for-react-native-0-77-full-guide-8fb9646b7ef5

    I'm using react-native-firebase version 20.5.0. please let me know if I can help.

  13. tahaipek commented on Feb 14, 2025

    @tahaipek

    @vishalksymentix and @Barot-sam, I plan to try out your solutions as soon as possible. I’ll share my experience here, letting you know whether the solution works and if I run into any issues. For now, I’ve implemented it as shown below and will continue with my work.

    I was facing unexpected crashes with Swift integration, so I temporarily switched back to Objective-C (.mm files) in RN 0.77. I followed these instructions to resolve the issue. This workaround is running smoothly for now, and I'll update once I get a stable Swift solution.

    Below is the code I used:

    AppDelegate.mm file:

    // Custom: Firebase, Background Application State
    #import "RNFBMessagingModule.h"
    
    #import "AppDelegate.h"
    #import <React/RCTBundleURLProvider.h>
    
    // highlight-next-line
    #import <ReactAppDependencyProvider/RCTAppDependencyProvider.h>
    
    // Custom: Firebase
    #import <Firebase.h>
    
    
    @implementation AppDelegate
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
      // Custom: Firebase
      [FIRApp configure];
      [application registerForRemoteNotifications];
    
      self.moduleName = @"DemoApp";
      
      // Custom: https://github.com/facebook/react-native-website/blob/main/website/blog/2025-01-21-version-0.77.md#rctappdependencyprovider
      self.dependencyProvider = [RCTAppDependencyProvider new];  // You can add your custom initial props in the dictionary below.
      
      self.initialProps = [RNFBMessagingModule addCustomPropsToUserProps:nil withLaunchOptions:launchOptions];
      return [super application:application didFinishLaunchingWithOptions:launchOptions];
    }
    
      // Custom: Firebase
    - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
      [FIRMessaging messaging].APNSToken = deviceToken;
    }
    
    - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
    {
      return [self bundleURL];
    }
    
    - (NSURL *)bundleURL
    {
    #if DEBUG
      return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
    #else
      return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
    #endif
    }
    
    @end
    
    

    AppDelegate.h file:

    #import <RCTAppDelegate.h>
    #import <UIKit/UIKit.h>
    
    @interface AppDelegate : RCTAppDelegate
    
    @end
    
    
  14. 37 remaining items

  15. blueromans commented on Mar 17, 2025

    @blueromans

    import UIKit
    import React_RCTAppDelegate
    import ReactAppDependencyProvider
    import FirebaseCore
    import FirebaseMessaging

    @main
    class AppDelegate: RCTAppDelegate, MessagingDelegate {
    override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    FirebaseApp.configure();
    Messaging.messaging().delegate = self
    application.registerForRemoteNotifications()

    self.moduleName = "***"
    self.dependencyProvider = RCTAppDependencyProvider()
    
    // You can add your custom initial props in the dictionary below.
    // They will be passed down to the ViewController used by React Native.
    self.initialProps = [:]
    
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    

    }

    override func sourceURL(for bridge: RCTBridge) -> URL? {
    return self.bundleURL()
    }

    override func bundleURL() -> URL? {
    #if DEBUG
    return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
    #else
    return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
    #endif
    }

    override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    Messaging.messaging().apnsToken = deviceToken
    }
    }

    this is the working one

  16. wasimirza-et commented on Mar 20, 2025

    @wasimirza-et

    https://medium.com/@wasi.mirza/react-native-0-78-firebase-phone-authentication-step-by-step-guide-af85be0a0621
    Please check my Medium Article for the 0.78 React Native setup.
    This will solve the problem. Hopefully for all.
    Thank you.

  17. github-actions commented on Apr 17, 2025

    @github-actions
    Contributor

    Hello 👋, to help manage issues we automatically close stale issues.

    This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

    This issue will be closed in 15 days if no further activity occurs.

    Thank you for your contributions.

  18. appli-intramuros commented on Jul 7, 2025

    @appli-intramuros

    This is what I've done (seems to work) with react-native v0.79.5 and react-native-firebase v21.11.0 :

    import Firebase // ADD THIS LINE
    import RNFBMessaging // ADD THIS LINE
    
    
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
      ) -> Bool {
    
        FirebaseApp.configure() // ADD THIS LINE
    
        let delegate = ReactNativeDelegate()
        let factory = RCTReactNativeFactory(delegate: delegate)
        delegate.dependencyProvider = RCTAppDependencyProvider()
    
        reactNativeDelegate = delegate
        reactNativeFactory = factory
    
        window = UIWindow(frame: UIScreen.main.bounds)
        
        // ADD THIS LINE
        let initialProps = RNFBMessagingModule.addCustomProps(toUserProps: nil, withLaunchOptions: launchOptions)
    
        factory.startReactNative(
          withModuleName: "XXXX",
          in: window,
          initialProperties: initialProps, // ADD THIS LINE
          launchOptions: launchOptions
        )
    
        return true
      }
    
  19. makedirectory commented on Oct 21, 2025

    @makedirectory

    This is what I've done (seems to work) with react-native v0.79.5 and react-native-firebase v21.11.0 :

    import Firebase // ADD THIS LINE
    import RNFBMessaging // ADD THIS LINE
    
    
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
      ) -> Bool {
    
        FirebaseApp.configure() // ADD THIS LINE
    
        let delegate = ReactNativeDelegate()
        let factory = RCTReactNativeFactory(delegate: delegate)
        delegate.dependencyProvider = RCTAppDependencyProvider()
    
        reactNativeDelegate = delegate
        reactNativeFactory = factory
    
        window = UIWindow(frame: UIScreen.main.bounds)
        
        // ADD THIS LINE
        let initialProps = RNFBMessagingModule.addCustomProps(toUserProps: nil, withLaunchOptions: launchOptions)
    
        factory.startReactNative(
          withModuleName: "XXXX",
          in: window,
          initialProperties: initialProps, // ADD THIS LINE
          launchOptions: launchOptions
        )
    
        return true
      }
    

    @mikehardy Can you please confirm if this is correct and let me know if the documentation needs to be updated. If so, I'll do it!

    I can add the changes here needed for ios/<Application>/AppDelegate.swift?

  20. mikehardy commented on Jan 29, 2026

    @mikehardy
    Collaborator

    I'm not sure this is handled, needs review

  21. added
    Workflow: Needs ReviewPending feedback or review from a maintainer.
    and removed on Jan 29, 2026
  22. Gopal-Avegen commented on Feb 2, 2026

    @Gopal-Avegen
  23. mikehardy commented on Feb 2, 2026

    @mikehardy
  24. russellwheatley commented on Aug 7, 2026

    @russellwheatley
    Member

    The install docs now have an RN 0.77+ AppDelegate.swift path (FirebaseApp.configure()), landed in #8265.
    Messaging background / isHeadless Swift docs are still incomplete. Tracking that separately in #8217.

    Closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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