Understand Firebase on Apple platforms | Firebase for Apple platforms (original) (raw)
As you're developing your Apple app using Firebase, you might discover concepts that are unfamiliar or specific to Firebase. This page aims to answer those questions or point you to resources to learn more.
If you have questions about a topic not covered on this page, feel free to visit one of our online communities. We'll also update this page with new topics periodically, so check back to see if we've added the topic you want to learn about!
Firebase library support by platform
The following table describes which Firebase libraries are compatible with which Apple platforms. For the time being, visionOS and watchOS are community-supported only. See theFirebase Apple platforms SDK GitHub repositoryfor installation instructions and known issues.
| Library | iOS | macOS | MacCatalyst | tvOS | visionOS | watchOS |
|---|---|---|---|---|---|---|
| A/B Testing | ||||||
| Firebase AI Logic 1 | iOS 15+ | macOS 12+ | Catalyst 15+ | tvOS 15+ (Community support only) | watchOS 8+ | |
| Analytics | v8.9.0+ | v8.9.0+ | v8.9.0+ | |||
| Analytics without Ad ID | v8.9.0+ | v8.9.0+ | v8.9.0+ | |||
| Analytics on-device conversion | ||||||
| App Check DeviceCheck provider | watchOS 9+ | |||||
| App Check App Attest provider | iOS 14+ | macOS 11+ | Catalyst 14+ | tvOS 15+ | watchOS 9+ | |
| App Check custom and debug providers | ||||||
| App Distribution | ||||||
| Authentication | partial | partial | partial | partial | partial | |
| Cloud Firestore | Source distros only | |||||
| Cloud Functions | ||||||
| Cloud Messaging | ||||||
| Cloud Storage | ||||||
| Crashlytics | ||||||
| Data Connect | ||||||
| Dynamic Links | ||||||
| Firebase installations | ||||||
| Firebase ML Model Downloader | ||||||
| In-App Messaging | ||||||
| Performance Monitoring | ||||||
| Realtime Database | ||||||
| Remote Config |
1 Firebase AI Logic was formerly called "Vertex AI in Firebase".
App Clips
Most Firebase libraries will build and run in an App Clip target, however, many are restricted as a result of underlying OS restrictions. Known issues include:
- Dynamic Links cannot send users to an App Clip if they tap a link without the app installed.
- Firestore and Realtime Database cannot load data in App Clips due to an underlying CFStream dependency.
See theFirebase GitHub repositoryfor a full list of known App Clip issues.
GoogleService-Info.plist
As part of adding Firebase to your Apple project, you need to add theGoogleService-Info.plist configuration file to your project. If you want to use multiple Firebase projects in a single app, visit the documentation forconfiguring multiple projects.
See theSwift reference documentationto learn about the Firebase app initialization process in more detail.
Swift Package Manager
Learn more about Swift Package Manager integration inour guide.
Swift Extensions
Firebase Apple platform SDK Swift extensions were formerly small, open source add-ons to the existing Firebase Apple platform libraries that enable your code to use Swift language-specific features. These APIs have since been added directly to the main libraries and don't need to be included separately. If you formerly had a Swift extension SDK in your codebase, see themigration guidefor upgrade instructions.
SwiftUI
Firebase fully supports SwiftUI, though the setup will be slightly different from UIKit apps in order for Firebase to function correctly in a fully SwiftUI environment. Take a look at thisblog postby Peter Friese for more details.
SwiftUI applications must disable swizzling due to aknown issue. See the app delegate swizzlingsection for more details.
App delegate swizzling
Firebase swizzles some methods in your app's app delegate class to automatically connect certain Firebase services to OS callbacks, likeFCM and the APNs token. You can disable swizzling in your app by adding the flag FirebaseAppDelegateProxyEnabled in the app’s Info.plist file and setting it to NO.
Four Firebase products use App Delegate swizzling: Analytics,App Distribution, Authentication, and FCM. If you've disabled swizzling in your application and you use any of the following products, refer to the product-specific guide to learn about how to use the product without swizzling:
Supporting iOS 14
iOS 14 includes new changes to user permissions surrounding the user's advertising identifier. See thepreparing for iOS 14 guidefor more details on whether or not your app may be affected.
Ongoing support for Objective-C
To ease maintenance of our Apple platforms documentation, Firebase has decided to concentrate on Swift snippets and code samples in our guides and other developer materials. Objective-C snippets will be removed from our guides starting January 1, 2024. We will continue to maintain up-to-datereference documentation for Objective-C for all Firebase products.
Open source resources for Firebase Apple platform SDKs
Firebase supports open source development, and we encourage community contributions and feedback.
Firebase Apple platform SDKs
All Firebase SDKs for Apple platforms except Analytics are developed as open source libraries in our publicFirebase GitHub repository.
FirebaseUI
FirebaseUI is a set of utility libraries built on Firebase, including a drop-in UI flow for authentication and data utilities for Cloud Firestore andRealtime Database. See more details about FirebaseUI on ourGitHub page.
Quickstart samples
Firebase maintains a collection of quickstart samples for most Firebase APIs on iOS. Find these quickstarts in our public Firebase GitHubquickstart repository.
You can open each quickstart in Xcode, then run them on a mobile device or simulator. Or you can use these quickstarts as example code for using Firebase SDKs.