Setting up Firebase

Setting up Firebase + Authentication in 3 simple steps

Open the app with XCode and set it up with your firebase database. Here are the steps:

  1. In this step, we will be taking the config file from firebase. For that, you need to:

Go to console.firebase.google.com > Get started > Enter project name > Copy your bundle Identifier from the app that you can find here and place it.

Once that is set, download the googleservice-info.plist and drop it in the root folder of your app.

Congratulations ! You have now connected your app with firebase !

  1. It is time to add authentication.

Click on Get started:

Here, you should find the different Authenticating methods. The boilerplate comes in with Email sign up, as well as google & apple sign up ! So activate the following:

Once that is set, all you need to do now is to activate Firestore (Our database)

  1. Activate Firestore:

You can start in production mode. You just need to change the settings of it in the next step.

Go to rules and change false to true as follows:

rules_version = '2';

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

We don't need to worry about other malicious people reaching the database because the app already comes in with appcheck, meaning that people can only reach your database from your app uniquely. It is secure from security breaches.

Well done, your firebase database is all set !

Note: The app might not run depending on your needs due to database indexing. If it is the case, you can see the url printed on the terminal when you run the app to add the index to your database.

Last updated