The great migration. Moving from Fabric to Firebase as an iOS developer.

In my day to day work and speaking at meet-ups, I am always surprised by how little most iOS developers know about Firebase, and the range of tools it has on offer for all developers. Being a Google technology this is understandable, but if you’re interested to learn more about what you can do with Firebase as an iOS developer then check out my blog series here.

For now, though, this post is going to focus on what you need to do to migrate your Crashlytics instance across from Fabric to Firebase.

I’m going to be using one of my more basic projects on GitHub to run this through, so feel free to post any questions if I miss anything that might be the case in more complex projects.

First off, if you use Fabric often, you’ll probably have noticed this header pop up in your dashboard. If you click on the Get Started button, you’ll be redirected to a handy migration assistant.

Now you might be asking, why make this blog post if Firebase has already made an assistant? Good question, but the aim of this post is to show you how easy it is to migrate even large repositories, and that it’s something you should be doing now rather than just before the upcoming deadline.

First off, you’ll be prompted to log in with your Google account. If it’s a personal project you can use your normal one, however, if you’re doing this for your company’s app it’s worth checking to see what your Android team-mates use for Firebase, or if there is a general Google account you can use for this.

Link your apps to Firebase

Before we can even start using Crashlytics within Firebase, we need to actually create the app in the Firebase console.

Once you click through to link your app, you’ll be greeted by a super handy dashboard.

Then you simply need to drag the app you want to link, over to the box on the right:

You’ll then be given a dialog where you can fill out the relevant information for your new Firebase app. You are then given the choice of whether to share your anonymous data with Google, of course, your choice!

You’ll then see a big button across the bottom of your screen to complete the link between the apps. If you logged into the Firebase console you would now see the app you just created, however it won’t have the link yet.

Hit that button, and confirm. You can now invite your team mates to your new Firebase app, and directly go to your new console and see what you’ve got set up already!

Now when you go back to the migration page, you’ll see your new Firebase app.

Adding Crashlytics

Now we have our new Firebase app set up, we can start to link up Crashlytics too.

To do this, you’ll want to head over to your app’s Firebase console. Once there, you’ll notice a little red dot over your new app, this is prompting you to finish the SDK set up so we can start using the full feature set of Firebase.

When you continue through this, all the app details such as the Bundle ID, are already populated from Fabric. Now we have to download the GoogleService-Info.plist file and add it to our project.

Next, you’ll want to add the Firebase/Core pod to your Podfile :

pod 'Firebase/Core'

Save the file and run:

pod install

Now we can add the initialisation code to our AppDelegate. This works in a similar way to the Crashlytics set up:

import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?)
-> Bool {
FirebaseApp.configure()
return true
}
}

Now run your app, and it should link up with Firebase automatically.

And that’s it! You’re up and running with Firebase, and Crashlytics should have automatically been turned on.

Head to the Quality section, and hit Crashlytics. You should reach a dashboard giving you all the information you need

Have fun exploring all the features on offer from Firebase, and feel free to message me should you have any questions.