Install Xcode 10.1 or later.
Install CocoaPods 1.4.0 or later.
Open your project in Xcode.
Your project must target iOS 8 or later.
Swift projects must use Swift 3.0 or later.
Set up a physical iOS device or the iOS simulator for running your app.
For Cloud Messaging, you'll need:
- A physical iOS device
- An Apple Push Notification Authentication Key for your Apple Developer account
- In Xcode, enable Push Notifications in App > Capabilities.
For all other Firebase products, you can use either a physical iOS device or the iOS simulator.
Sign into Firebase using your Google account.
If you don't already have an Xcode project, you can download one of our quickstart samples if you just want to try out a Firebase product.
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 Platform (GCP) project, you can select the project from the Project name dropdown menu. Otherwise, enter a new Project name.
(Optional) 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.
Follow the remaining setup steps in the Firebase console, then click Create project (or Add Firebase, if you're using an existing Google 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.
In the center of the Firebase console's 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.
- Find this bundle ID by opening your app in XCode, then accessing the
General tab in the top-level
Runnerdirectory. The value of the Bundle Identifier field is the iOS bundle ID (for example,
- Find this bundle ID by opening your app in XCode, then accessing the General tab in the top-level
(Optional) Enter other app information as prompted by the setup workflow.
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 for Firebase 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 (
You can download your Firebase iOS config file again at any time.
Make sure the config file 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
Note that if you're using one of the quickstart samples, the Xcode project and Podfile (with pods) are already present, but you'll still need to add your Firebase configuration file and install the pods.
You can add any of the supported Firebase products to your iOS app. We recommend starting with Google Analytics for Firebase.
Create a Podfile if you don't already have one:
To your Podfile, add the pods that you want to use in your app. For example, for Analytics:
This pod will add the prerequisite libraries needed to get Firebase up and running in your iOS app, along with Google Analytics for Firebase.
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];
After you add the initialization code, run your app to send verification to the Firebase console that you've successfully installed Firebase.
The following pods are available for the various Firebase products.
|Cloud Firestore||pod 'Firebase/Firestore'|
|Cloud Functions for Firebase Client SDK||pod 'Firebase/Functions'|
|Cloud Messaging||pod 'Firebase/Messaging'|
|Cloud Storage||pod 'Firebase/Storage'|
|Dynamic Links||pod 'Firebase/DynamicLinks'|
|In-App Messaging||pod 'Firebase/InAppMessaging'|
|In-App Messaging Display||pod 'Firebase/InAppMessagingDisplay'|
|ML Kit: Vision APIs||pod 'Firebase/MLVision'|
|ML Kit: Image Labeling Model||pod 'Firebase/MLVisionLabelModel'|
|ML Kit: Barcode Scanning Model||pod 'Firebase/MLVisionBarcodeModel'|
|ML Kit: Text Recognition Model||pod 'Firebase/MLVisionTextModel'|
|ML Kit: Face Detection Model||pod 'Firebase/MLVisionFaceModel'|
|ML Kit: Object Detection and Tracking Model||pod 'Firebase/MLVisionObjectDetection'|
|ML Kit: Natural Language APIs||pod 'Firebase/MLNaturalLanguage'|
|ML Kit: Language Identification Model||pod 'Firebase/MLNLLanguageID'|
|ML Kit: Translate Model||pod 'Firebase/MLNLTranslate'|
|ML Kit: Smart Reply Model||pod 'Firebase/MLNLSmartReply'|
|ML Kit: Custom Model APIs||pod 'Firebase/MLModelInterpreter'|
|ML Kit: AutoML Vision Edge API||pod 'Firebase/MLVisionAutoML'|
|Performance Monitoring||pod 'Firebase/Performance'|
|Realtime Database||pod 'Firebase/Database'|
|Remote Config||pod 'Firebase/RemoteConfig'|
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.
Download the framework SDK zip. This is a ~1GB 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 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 features 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.