Combine Google Firebase Crashlytics in iOS app utilizing swift – iOSTutorialJunction


Firebase crashlytics SDK helps builders to get actual time crash stories of their apps. Crashlytics SDK logs down a crash and supply data to the developer the place precisely its coming from. This fashion, developer can repair crash prevalence in app subsequent launch and make app extra steady to its customers. On this tutorial, we’re going to discover ways to combine Firebase Crashlytics SDK in our iOS app utilizing swift language.

Including Firebase SDK

Very first thing we have to add Firebase SDK and different dependencies to our venture. Observe the beneath given steps so as to add Firebase SDK to the venture.

  1. Go to https://console.firebase.google.com/
  2. Click on on Add venture.
  3. Enter venture title.
  4. Hyperlink Google analytics to the venture.(Observe the steps proven by Firebase console window)
  5. Choose present location(nation we’re residing in).
  6. Settle for situations and click on on create venture.
  7. Click on Proceed.
  8. A display screen with our venture dashboard will open up.
  9. Click on on iOS icon as we need to add Firebase SDK for iOS.
  10. Observe the 5 steps, as described within the net web page. (Notice:- One can selected totally different set up strategies, however the really helpful one is by way of SPM(Swift Package deal Supervisor))

Utilizing Firebase Crashlytics SDK

Observe beneath Steps:

  • Drag and drop GoogleService-Data.plist into the venture folder.
  • Open AppDelegate.swift and import Firebase, followe by configure command.
import UIKit
import Firebase

@predominant
class AppDelegate: UIResponder, UIApplicationDelegate {

    func software(_ software: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override level for personalization after software launch.
        FirebaseApp.configure()
        return true
    }
}
Combine Google Firebase Crashlytics in iOS app utilizing swift – iOSTutorialJunction
  1. Choose the venture in Challenge Naviagtor
  2. Choose venture goal listed beneath TARGETS, in our case its ‘CrashlyticsDemo‘.
  3. Choose Construct Phases.
  4. Click on on + icon, then choose New Run Script Section.
  5. Below shell part add beneath run script
"${BUILD_DIR%/Construct/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"

Notice:- In case you are utilizing cocoa pods for set up, then you must add given beneath shell command

"${PODS_ROOT}/FirebaseCrashlytics/run"

The above scripts are required as crashlytics requires, app to add debug symbols. Run script construct section for Xcode will routinely add debug symbols post-build.
Fore extra data examine this hyperlink: https://firebase.google.com/docs/ios/installation-methods

Subsequent steps is to add DYSM information. Within the Enter Information part, add the paths for the areas of the next information:

  1. The placement of venture’s dSYM information:
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Assets/DWARF/${TARGET_NAME}

As per documentation, offering the placement of your venture’s dSYM information permits Crashlytics to course of dSYMs for big apps extra shortly.

2. The placement of your venture’s constructed Data.plist file:

$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

As per Firebase crashlytics documentation, offering the placement of your venture’s constructed Data.plist file permits Crashlytics to affiliate an app model with the dSYMs.

Lastly, beneath Construct Settings of TARGETS and PROJECT. Seek for Debug data format, and set it as “DWARF with DYSM file”.

Debug information format, and set it as DWARF with DYSM file  xcode ios firebase crashlytics

The place to go from right here

On this publish, we discovered about how can we use Firebase crashlytics in iOS app utilizing swift language. Given benefits supplied by crashlytics to report crash inside app in a really descriptive manner, it’s a really needy factor to make use of within the cell app.



Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles