If you don't have an Xcode project already, you can download one of our
quickstart samples if you just want to try a Firebase
feature. If you're using a quickstart, remember to get the bundle identifier
from the project settings, you'll need it for the next step.

After Firebase provisions resources for your
Firebase project, you cannot change the project ID.
So, if you want to use a specific identifier with your Firebase services,
you must enter that identifier for the project ID during this setup step.

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. The
process typically takes a few minutes. When the process completes, you'll be
taken to the overview page for your Firebase project in the Firebase console.

Now that you have a project, you can add your iOS app to it:

Click Add Firebase to your iOS app and follow the setup steps. If you're
importing an existing Google project, this may happen automatically and you
can just
download the config file.

When prompted, enter your app's bundle ID. It's important to enter the
bundle ID your app is using; this can only be set when you add the app to
your Firebase project.

The file's content is considered public, including your platform-specific
ID (entered in the Firebase console setup wizard) and values that are
specific to your Firebase project, like your Realtime Database URL and
Storage bucket name. Given this, use security rules
to protect your data in
Realtime Database,
Cloud Firestore,
and Storage.

For open source projects, we generally do not recommend including your
config file in source control because, in most cases, your users should
create their own Firebase projects and point their apps to their own
backends.

After you add the initialization code, run your app to send verification to
the Firebase console that you've successfully installed Firebase.

Note: If you have multiple build variants with different bundle IDs defined,
each app must be added to your project in Firebase console.

Add the SDK

If you are setting up a new project, you need to install the SDK. You may have
already completed this as part of creating a Firebase project.

If you are planning to download and run one of the
quickstart samples, the Xcode project and Podfile are
already present, but you'll still need to install the pods and download
the GoogleService-Info.plist file. If you would like to integrate the Firebase
libraries into one of your own projects, you will need to add the pods
for the libraries that you want to use.

If you don't have an Xcode project yet, create one now.

Create a Podfile if you don't have one:

$ cd your-project directory
$ pod init

Add the pods that you want to install. You can include a Pod in your
Podfile like this:

pod 'Firebase/Core'

This will add the prerequisite libraries needed to get Firebase up and running
in your iOS app, along with Google Analytics for Firebase. A list of currently
available pods and subspecs is provided below. These are
linked in feature specific setup guides as well.

Install the pods and open the .xcworkspace file to see the project in Xcode.

$ pod install
$ open your-project.xcworkspace

Download a GoogleService-Info.plist file from Firebase console
and include it in your app.

Note: If you have multiple bundle IDs in your project, each bundle ID must be
connected in Firebase console so it can have its own
GoogleService-Info.plist file.

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 are using a
quickstart this has been done for you.