You're viewing the legacy docs. They are deprecated as of May 18, 2016.
These docs are for version 2.5.1 and below of the Objective-C SDK. Go to our current docs, or see our iOS migration guide.

Objective-C and Swift iOS Guide

Installation & Setup

In this document, we'll guide you though adding the Firebase iOS client library to your project. You can also use this client library to build native OS X applications.

Create an account

First sign up for a free account. A new Firebase app will be created for you with a unique URL ending in firebaseio.com. You'll use this URL to store and sync data.

Within the App Dashboard you can create, manage and delete Firebase apps. Clicking on a specific Firebase app lets you view and modify your app's data in realtime. In the dashboard, you can also set Security and Firebase Rules, manage your app's authentication, deploys, and view analytics.

CocoaPods Setup

CocoaPods is the easiest way to get started with the Firebase iOS SDK. If you're new to CocoaPods, visit their getting started documentation.

To initialize CocoaPods in your project, run the following commands:

$ cd your-project-directory
$ pod init
$ open -a Xcode Podfile # opens your Podfile in XCode

Once you've initialized CocoaPods, just add the Firebase Pod to your Podfile:

pod 'Firebase', '>= 2.5.1'

Then run the command:

$ pod install
$ open your-project.xcworkspace

Now you're ready to get started in XCode.

Alternative Setup

For instructions on including the Firebase framework and its dependencies manually see the guide on alternative setup here.

Getting started in Xcode

Objective-C

Include the Firebase header in your app to get all the needed classes:

#import <Firebase/Firebase.h>

Swift

You can start using Firebase in your Swift class by simply importing Firebase:

import Firebase
  1. 1

    Next

    Installation & Setup

  2. 2

    Next

    Understanding Data

  3. 3

    Next

    Saving Data

  4. 4

    Next

    Retrieving Data

  5. 5

    Next

    Structuring Data

  6. 6

    Next

    Understanding Security

  7. 7

    Next

    User Authentication

  8. 8

    Next

    Offline Capabilities