firebase
Firebase (Apple SDK)
Firebase is Google's third-party SDK, not Apple's — it ships from github.com/firebase/firebase-ios-sdk, carries its own release cadence, and depends on a GoogleService-Info.plist you download from the Firebase Console. The deep API reference — install, configuration, the full Auth flows (email/password, anonymous, Sign in with Apple), Firestore CRUD/queries/listeners/transactions, offline persistence, security rules, and the service/manager patterns — lives in references/guide.md. This file is the decision and discipline layer: read it first, open the guide for specifics.
Dials
Set these explicitly at the start; they change what "correct" means.
BACKEND— which Firebase products you pull in as SwiftPM products:auth·firestore(document NoSQL, the default data store) ·rtdb(Realtime Database, for low-latency presence/streaming) ·storage(Cloud Storage for files) ·messaging(FCM push) ·analytics·crashlytics. Add only the products you use; each is a separate.product(name:, package: "Firebase").AUTH_PROVIDERS—none·email·anonymous·apple(Sign in with Apple viaOAuthProvider.appleCredential, requires nonce) ·federated(Google/others). Anonymous-then-link is a common upgrade path.FIRESTORE_CACHE—persistent(default;PersistentCacheSettings(), survives launches, serves reads offline) ·memory(MemoryCacheSettings(), cleared on relaunch). Set onFirestore.firestore().settingsbefore the first Firestore call.
When to use
Building or reviewing any code that talks to Firebase from an iOS/Swift app — sign-in, Firestore/RTDB reads and writes, real-time listeners, file uploads, push registration, crash reporting, or analytics. If the app uses a different backend (Supabase, CloudKit, a custom API), use that instead — don't run two backends as competing sources of truth.