How to add Firebase SDK to an iOS Swift app with Xcode.

Tram Ho

Firebase is a service built by Google, assisting us with a lot of things in the app building process: from authentication, realtime database, cloud storage to Analytic and User tracking. Let’s take a look at this useful tool, and how to add Firebase SDK to your app

First, to use this tool, you need to create a firebase account -> create a new project. Then you need to add firebase to your project following the steps below:

  1. Go to the Firebase dashboard.
  2. In the middle of the project dashboard, click the iOS icon (plat_ios) to launch the setup process. If you added an app to your Firebase project, click Add an app to display the platform options.
  3. Enter bundle id of your app in the iOS bundle field.
  4. Enter other information of the app: App nick name and App store id
  5. Select Register app.

Add the Firebase Configuration file:

  1. In the above section, select Download GoogleService-Info.plist to download the config file
  2. Drag the file just downloaded above into the project

Then you need to install the Firebase SDK into your app using the pod: Add the following lines to your pod file:

Then run pod install

In App Delegate import the Firebase library

Then add the following line of code to the application function: didFinishLaunchingWithOptions:

You are finished adding the Firebase SDK to your app.

Share the news now

Source : Viblo