LimitedRound 2 is open. Get your first month free, no extra charge.Join the waitlist ›
Wire in your backend

How to add Firebase to your iOS app

TL;DR. Firebase gives an iOS app authentication, a realtime NoSQL database in Firestore, storage, and analytics. You add the SDK, drop in your GoogleService-Info.plist, and call configure at launch. Firebase uses a config file rather than a single key, and its security rules are what protect your data.

What Firebase does for an iOS app

Firebase bundles the common backend needs into one SDK. Firebase Auth handles email, phone, and Sign in with Apple. Firestore is a document database that syncs in realtime, which is handy for chat, collaborative lists, and live state. Cloud Storage holds files. Firebase Analytics and Crashlytics cover usage and crash reporting. The trust model is the GoogleService-Info.plist, which carries project identifiers and is meant to ship in the app, plus Security Rules that decide who can read and write each document.

Adding Firebase with AppFlight

AppFlight's first-party connector stack centers on Supabase, so Firebase is added the way any external SDK is: you ask the AI to add the Firebase Swift package, include your GoogleService-Info.plist, and call configure at launch. The plist is a client config that ships in the app. Any Firebase Admin SDK credentials are secrets and stay server-side only, never in the binary. From there you can ask the AI to wire up Firestore reads or a sign-in screen, and it generates the SwiftUI.

A SwiftUI example

Configure Firebase at launch, then read a Firestore collection:

import FirebaseCore
import FirebaseFirestore
import SwiftUI

@main
struct MyApp: App {
    init() { FirebaseApp.configure() }
    var body: some Scene {
        WindowGroup { ContentView() }
    }
}

struct Note: Codable, Identifiable {
    @DocumentID var id: String?
    let title: String
}

struct NotesView: View {
    @State private var notes: [Note] = []

    var body: some View {
        List(notes) { note in Text(note.title) }
            .task {
                let snapshot = try? await Firestore.firestore()
                    .collection("notes")
                    .getDocuments()
                notes = snapshot?.documents.compactMap {
                    try? $0.data(as: Note.self)
                } ?? []
            }
    }
}

Alternatives

Supabase is the closest comparison and gives you real Postgres, SQL queries, and an open-source stack you can self-host, which is why AppFlight uses it as the default backend. CloudKit is free inside Apple's ecosystem and pairs naturally with iCloud, but it is Apple-only. Firebase earns its place when you want Firestore's realtime document sync, Google's analytics, or Crashlytics, and you do not mind a Google-owned, NoSQL stack.

FAQ

Does Firebase need a secret key in the app?

No. Firebase ships a GoogleService-Info.plist config file in the app, which contains identifiers rather than a secret. Your data is protected by Firebase Security Rules, not by hiding the config. Admin SDK credentials are the secret ones and stay server-side only.

Firebase or Supabase for a new iOS app?

Firebase is strong for realtime sync, push, and a mature analytics suite, with a NoSQL document model. Supabase gives you real Postgres and SQL with an open-source stack you can self-host. AppFlight uses Supabase as its keystone backend, so Firebase fits best when you specifically want Firestore or Google analytics.

Is Firebase free?

Firebase has a free Spark tier with usage limits, then a pay-as-you-go Blaze plan. Check the current Firebase pricing page, since limits for Firestore reads, storage, and functions change over time.

Sources

Build this app without opening Xcode.

AppFlight turns a plain-English prompt into a real native iOS app and ships it to the App Store. Round 2 is open: free for your first month.

Join the waitlist