Start a Project

How to integrate Crashlytics in iOS App?

Dear Reader, I hope you are doing well. Today we are going to learn, how to integrate Crashlytics in iOS App. Crashlytics is the most powerful crash reporting tool provided by Google Developers. By integrating into iOS App, we can get the crash reports in the firebase console in real-time. To integrate this in-app follow below steps.

  1. Create iOS Project in firebase console.

2. Next step is below screen is, you have to click on Add another app button then after click on Add firebase to your iOS App option

3. Register App by entering the iOS bundle ID. This must be same as mentioned in XCode project.

4. You will get the GoogleService-Info.plist option. Click to Download that file and drag into your Xcode project Directory.

5. In firebase console,

  • Click on Crashlytics in Stability Section.
  • Then Choose the correct bundle identifier drop-down menu.
  • Click on Setup Crashlytics

6. After Clicking that option you will be provided below screen.

  • Choose the appropriate option according to your app. If you app doesn’t have any version of Crashlytics SDK before. Select first one.

7. After clicking First option, you will see below options.

  • Click on Go to Crashlytics Docs (new tab will open in your browser).
  • You can read the documention details on that website. (you may igone reading follow next step, I will explain everything here)

8. Install the following pods in your project.

  • Add below line in didFinishLaunchingWithOptions in Appdelegate.

9.  Very Important Step. (Don’t forget otherwise it will not work). Follow as shown in below image.

10. Add below line in Run Script as shown in image.

11. This is also a very important step. Must follow below steps as shown in image if you want to get the crash reports.

Now All Step is finished.

To Demonstrate the crashlytics working method, I created a demo app. As shown below image.

In this scenario whenever, I will on the button. This will definitely crash the app as I want to access the element of 3rd position in an array which does not exist. Thus the app will crash.

Reload the firebase console and follow the 5th step again to see the crash reports.

 

If you still not able to understand any steps. Please let me know in below comment. See you soon.

 

 

 

 

Exit mobile version