Skip to content

rybaier/rnfirebase-custom-plugin-for-expo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 

Repository files navigation

firebase-plugin-appdelegate

πŸ”Œ A custom Expo config plugin that automatically injects FirebaseApp.configure() into your iOS AppDelegate.swift or AppDelegate.m, during prebuild, enabling Firebase setup without manual native code editing.


πŸš€ Features

  • βœ… Supports both Swift (AppDelegate.swift) and Objective-C (AppDelegate.m)
  • βœ… Adds missing import FirebaseCore / #import <FirebaseCore/FirebaseCore.h>
  • βœ… Injects FirebaseApp.configure() or [FIRApp configure]; into didFinishLaunchingWithOptions
  • βœ… Gracefully creates a fallback AppDelegate.swift if none exists
  • βœ… Logs helpful output without breaking your build
  • βœ… Compatible with expo prebuild, expo run:ios, and eas build

πŸ“¦ Installation

πŸ“‹ Requirements This plugin requires the following package to be installed in your project: @expo/config-plugins

GoogleService-Info.plist file in your project directory, e.g., ios/appName/GoogleService-Info.plist.

πŸ“‹ Installation Place the plugin in your project directory, e.g., plugins/firebase-plugin-appdelegate.js.

Then update expo plugins array in your app.config.js:

module.exports = {
  expo: {
    name: "YourApp",
    slug: "your-app",
    plugins: [
      // βœ… Register the plugin
      "./plugins/firebase-plugin-appdelegate"

      // ⚠️ Avoid react-native-firebase plugins here β€” handled manually
      // Remove or comment out the following if present:
      // "@react-native-firebase/app",
      // "@react-native-firebase/auth",
      // "@react-native-firebase/firestore",
      // "@react-native-firebase/storage",
    ]
  }
};

πŸ™ Credits

Originally written by Ryan Baier as an Expo config plugin to automate Firebase setup in Swift and Objective-C iOS projects.

This plugin was built with guidance on:

  • Expo's config plugin system
  • Native module injection strategies
  • Firebase iOS initialization patterns

About

Custom plugin for react-native-firebase projects using Expo SDK 53

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors