Why Firebase? You see, when we started with the Making friends with TDD post we wrote test cases for password validations. In order to complete the cycle, we’ll be using Firebase to let our users sign up and log in into our application. Firebase acts as the backend we never designed or wrote and guess what, it is FREE FREE FREE \m/ *Drooling Now* for limited usage though!
For setting it up there are few steps involved. Let’s get through this in a jiffy!
- Head to https://firebase.google.com/
- Log in to your account or create a new account.
- After logging in, you’ll be asked to create a new project. Fill in the details and continue. This won’t take long.
- Now, let us add it to our iOS app.
- Here we’ll need the application details. Bundle identifier, App nickname etc.
Ya, I know! It’s pretty darn easy. But you see we are programmers! WE DON’T DO EASY! :p
Let’s configure Firebase!
Let us begin with importing the Firebase module in our UIApplicationDelegate subclass, which happens to be the AppDelegate class. Add import Firebase at the top of the class. Similar to shown below.
We now need to initialize the Firebase, in our AppDelegate’s application:didFinishLaunchingWithOptions:
// Use Firebase library to configure APIs
That was quick, right? Let us head to the Asynchronous Testing in Swift! post for the real deal. 😉