Install the following:
- Xcode 13.3.1 or later
Make sure that your project meets these requirements:
- Your project must target these platform versions or later:
- iOS 10
- macOS 10.12
- tvOS 12
- watchOS 6
- Your project must target these platform versions or later:
Set up a physical Apple device or use a simulator to run your app.
Do you want to use Cloud Messaging?
For Cloud Messaging on Apple platforms, here are the prerequisites:
- Set up a physical Apple device.
- Obtain an Apple Push Notification Authentication Key for your Apple Developer account.
- Enable Push Notifications in Xcode under App > Capabilities.
- Sign into Firebase using your Google account.
If you don't already have an Xcode project and just want to try out a Firebase product, you can download one of our quickstart samples.
Step 1: Create a Firebase project
Before you can add Firebase to your Apple app, you need to create a Firebase project to connect to your app. Visit Understand Firebase Projects to learn more about Firebase projects.
Create a Firebase project
In the Firebase console, click Add project.
To add Firebase resources to an existing Google Cloud project, enter its project name or select it from the dropdown menu.
To create a new project, enter the desired project name. You can also optionally edit the project ID displayed below the project name.
If prompted, review and accept the Firebase terms.
(Optional) Set up Google Analytics for your project, which enables you to have an optimal experience using any of the following Firebase products:
Either select an existing Google Analytics account or to create a new account.
If you create a new account, select your Analytics reporting location, then accept the data sharing settings and Google Analytics terms for your project.
Click Create project (or Add Firebase, if you're using an existing Google Cloud project).
Firebase automatically provisions resources for your Firebase project. When the process completes, you'll be taken to the overview page for your Firebase project in the Firebase console.
Step 2: Register your app with Firebase
To use Firebase in your Apple app, you need to register your app with your Firebase project. Registering your app is often called "adding" your app to your project.
Go to the Firebase console.
In the center of the project overview page, click the iOS+ icon to launch the setup workflow.
If you've already added an app to your Firebase project, click Add app to display the platform options.
Enter your app's bundle ID in the bundle ID field.
What's a bundle ID, and where do you find it?
A bundle ID uniquely identifies an application in Apple's ecosystem.
Find your bundle ID: open your project in Xcode, select the top-level app in the project navigator, then select the General tab.
The value of the Bundle Identifier field is the bundle ID (for example,
Be aware that the bundle ID value is case-sensitive, and it cannot be changed for this Firebase app after it's registered with your Firebase project.
(Optional) Enter other app information: App nickname and App Store ID.
How are the App nickname and the App Store ID used within Firebase?
App nickname: An internal, convenience identifier that is only visible to you in the Firebase console
App Store ID: Used by Firebase Dynamic Links to redirect users to your App Store page and by Google Analytics to import conversion events into Google Ads. If your app doesn't yet have an App Store ID, you can add the ID later in your Project settings.
Click Register app.
Step 3: Add a Firebase configuration file
Click Download GoogleService-Info.plist to obtain your Firebase Apple platforms config file (
What do you need to know about this config file?
The Firebase config file contains unique, but non-secret identifiers for your project. To learn more about this config file, visit Understand Firebase Projects.
You can download your Firebase config file again at any time.
Make sure the config file name is not appended with additional characters, like
Move your config file into the root of your Xcode project. If prompted, select to add the config file to all targets.
If you have multiple bundle IDs in your project, you must associate each bundle
ID with a registered app in the Firebase console so that each app can have
Step 4: Add Firebase SDKs to your app
Use Swift Package Manager to install and manage Firebase dependencies.
- In Xcode, with your app project open, navigate to File > Add Packages.
- When prompted, add the Firebase Apple platforms SDK repository:
- Select the SDK version that you want to use.
Choose the Firebase libraries you want to use.
If Google Analytics is enabled in your Firebase project, make sure to add
FirebaseAnalytics. For Analytics without IDFA collection capability, add
When finished, Xcode will automatically begin resolving and downloading your dependencies in the background.
Step 5: Initialize Firebase in your app
The final step is to add initialization code to your application. You may have already done this as part of adding Firebase to your app. If you're using a quickstart sample project, this has been done for you.
- Import the
FirebaseCoremodule in your
UIApplicationDelegate, as well as any other Firebase modules your app delegate uses. For example, to use Cloud Firestore and Authentication:
import FirebaseCore import FirebaseFirestore import FirebaseAuth // ...
@import FirebaseCore; @import FirebaseFirestore; @import FirebaseAuth; // ...
- Configure a
FirebaseAppshared instance, typically in your
App's initializer or app delegate's
// Use Firebase library to configure APIs FirebaseApp.configure()
// Use Firebase library to configure APIs [FIRApp configure];
- If you've included the Firebase SDK for Google Analytics, you can run your app to send verification to the Firebase console that you've successfully installed Firebase.
That's it! You can skip ahead to the next steps.
If you're having trouble getting set up, though, visit the Apple platforms troubleshooting & FAQ.
This section lists the Firebase products supported for Apple platforms. Learn more about these Firebase Apple platform libraries:
|Service or Product||Pods||SwiftPM Libraries||Add Analytics?|
|Cloud Functions for Firebase Client SDK||
|Firebase ML Custom Model APIs||
Integrate without a dependency manager
If you don't want to use Swift Package Manager, you can still take advantage of the Firebase SDKs by importing the frameworks directly or by using CocoaPods.
In addition to supporting the iOS platform, the zip now includes
files. For details, see the Firebase
Apple platforms SDK README on
Download the framework SDK zip. This is a ~200MB file and might take some time to download.
Unzip the file, then review the
READMEfor the frameworks that you want to include in your app.
-ObjClinker flag in your
Other Linker Settingsin your target's build settings.
Learn more about CocoaPods integration in our guide.
Learn about Firebase:
Visit Understand Firebase Projects to learn more about Firebase projects and best practices for projects.
Explore sample Firebase apps.
Get hands-on experience with the Firebase iOS Codelab.
Explore the open source code in GitHub.
Prepare to launch your app:
Having trouble with Firebase and your Apple project? Visit the Apple platforms troubleshooting & FAQ.
Add Firebase services to your app:
Gain insights on user behavior with Analytics.
Set up user authentication with Authentication.
Store files, like photos and videos, with Cloud Storage.
Trigger backend code that runs in a secure environment with Cloud Functions.
Send notifications with Cloud Messaging.
Find out when and why your app is crashing with Crashlytics.