π 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.
- β
Supports both Swift (
AppDelegate.swift) and Objective-C (AppDelegate.m) - β
Adds missing
import FirebaseCore/#import <FirebaseCore/FirebaseCore.h> - β
Injects
FirebaseApp.configure()or[FIRApp configure];intodidFinishLaunchingWithOptions - β
Gracefully creates a fallback
AppDelegate.swiftif none exists - β Logs helpful output without breaking your build
- β
Compatible with
expo prebuild,expo run:ios, andeas build
π 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",
]
}
};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