How to add new Firebase Crahlytics SDK to your iOS project?

Now a days Fabric is sending notice for migrating, as I got email today about [FINAL NOTICE] Fabric is shutting down May 4, 2020. We can move to the new Firebase Crashlytics SDK.

Integrating the new Firebase Crashlytics SDK is quick and easy. Let’s take a look.

Installation

If your project is not configured in Firebase then create project on Firebase console and configure it in your project. After that follow the steps:

Step 1 – Go to your Podfile and add Firebase Crashlytics Pods in your project.

Note: Don’t forget to remove Fabric pod if you have already integrated Fabric Crashlytics

Step 2 – Install Pods and open your workspace.

Step 3 – Add Run Script

Note: If your project already have then don’t forget update the run script as above.

Configure

Firebase Crashlytics will be configured as follows:

Step 1 – Import Firebase module in your UIApplicationDelegate:

Swift

Objective-C

Step 2 – Configure a FirebaseApp shared instance, in your app’s application:didFinishLaunchingWithOptions: method:

Swift

Objective-C

Note: If your project already have other functionality of Firebase then above step is not required.

Run and Crash

Clean build and run the project. If you want to test your implementation then use following command.

Swift

Objective-C

You can check Firebase Crashlytics console for this test crash.

I hope you learned something. You may also check out this article from Toptal about: How to Build a Role-based API with Firebase Authentication. If you did, feel free to share this article with a friend or on social media. Let me know if you have any questions, comments or feedback – either via Twitter or email.

Stay Safe At Home. Learn Something New. Share To The World.
Happy Coding ?