Install the following:
- Xcode 12.2 or later
- CocoaPods 1.10.0 or later
Make sure that your project meets these requirements:
- Your project must target iOS 10 or later.
Set up a physical iOS device or use the iOS simulator to run your app.
Do you want to use Cloud Messaging?
For Cloud Messaging on iOS, here are the prerequisites:
- Set up a physical iOS 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 iOS app, you need to create a Firebase project to connect to your iOS app. Visit Understand Firebase Projects to learn more about Firebase projects.
Create a Firebase project
In the Firebase console, click Add project, then select or enter a Project name.
If you have an existing Google Cloud project, you can select the project from the dropdown menu to add Firebase resources to that project.
(Optional) If you are creating a new project, you can edit the Project ID.
Firebase automatically assigns a unique ID to your Firebase project. Visit Understand Firebase Projects to learn about how Firebase uses the project ID.
(Optional) Set up Google Analytics for your project, which enables you to have an optimal experience using any of the following Firebase products:
When prompted, select to use an existing Google Analytics account or to create a new account.
If you choose to 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
After you have a Firebase project, you can add your iOS app to it.
Visit Understand Firebase Projects to learn more about best practices and considerations for adding apps to a Firebase project, including how to handle multiple build variants.
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 iOS 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 iOS 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 iOS bundle ID (for example,
Be aware that the bundle ID value is case-sensitive, and it cannot be changed for this Firebase iOS 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 iOS 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
Create a Podfile if you don't already have one:
To your Podfile, add the Firebase pods that you want to use in your app.
You can add any of the supported Firebase products to your iOS app.
platform :ios, ‘10.0’
# Add the Firebase pod for Google Analytics pod 'Firebase/Analytics'
# Add the pods for any other Firebase products you want to use in your app # For example, to use Firebase Authentication and Cloud Firestore pod 'Firebase/Auth' pod 'Firebase/Firestore'
Analytics not enabled
platform :ios, ‘10.0’
# Add the pods for the Firebase products you want to use in your app # For example, to use Firebase Authentication and Cloud Firestore pod 'Firebase/Auth' pod 'Firebase/Firestore'
Install the pods, then open your
.xcworkspacefile to see the project in Xcode:
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 Firebase module in your
- Configure a
FirebaseAppshared instance, typically in your app's
// Use Firebase library to configure APIs FirebaseApp.configure()
// Use Firebase library to configure APIs [FIRApp configure];
- If you've included Firebase 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.
This section lists the Firebase products supported for iOS and their pods. Learn more about these Firebase iOS libraries:
|Service or Product||Pods||Add Analytics?|
|Cloud Functions for Firebase Client SDK||
|Firebase ML Custom Model APIs||
Integrate without CocoaPods
If you don't want to use Cocoapods, you can still take advantage of the Firebase SDKs by importing the frameworks directly or using the Swift Package Manager.
In addition to supporting the iOS platform, the zip now includes .xcframework files that add community-based Catalyst support. For details, see the Firebase iOS SDK README on GitHub .
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.
Swift Package Manager
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:
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.