10.1 C
Canberra
Friday, September 20, 2024

Combine Google Firebase Crashlytics in iOS app utilizing swift – iOSTutorialJunction


The Firebase Crashlytics SDK permits builders to obtain real-time crash reviews for his or her apps. It logs crashes and offers detailed details about their origins, enabling builders to deal with and resolve points in subsequent app releases. This, in flip, enhances the app’s stability for customers. On this tutorial, we are going to learn to combine the Firebase Crashlytics SDK into an iOS app utilizing Swift.

Including Firebase SDK

Step one is so as to add the Firebase SDK and different dependencies to our mission. Observe the steps beneath so as to add the Firebase SDK to your mission.

  1. Go to Firebase Console.
  2. Click on on Add mission.
  3. Enter your mission identify.
  4. Hyperlink Google Analytics to the mission by following the steps proven within the Firebase console window.
  5. Choose your present location (nation you’re residing in).
  6. Settle for the phrases and situations, then click on on Create mission.
  7. Click on Proceed. A display together with your mission dashboard will open.
  8. Click on on the iOS icon as we wish to add the Firebase SDK for iOS.
  9. Observe the 5 steps given on the official webpage so as to add Firebase to your iOS app. Word that totally different set up strategies can be found, however the really helpful methodology is through Swift Bundle Supervisor (SPM).

Utilizing Firebase Crashlytics SDK in iOS

Observe beneath Steps:

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

@foremost
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 mission in Venture Naviagtor
  2. Choose mission 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. Underneath shell part add beneath run script
"${BUILD_DIR%/Construct/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"

Word:- In case you are utilizing cocoa pods for set up, then it’s good to add given beneath shell command

"${PODS_ROOT}/FirebaseCrashlytics/run"

The above scripts is required as a result of crashlytics wants, app to add debug symbols to be able to use it to switch the symbols within the crash logs with the suitable strategies names so will probably be readable and can make sense. Run script construct section for Xcode will robotically add debug symbols post-build.
Fore extra information examine this hyperlink: https://firebase.google.com/docs/ios/installation-methods

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

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

As per documentation, offering the situation of your mission’s dSYM information allows Crashlytics to course of dSYMs for big apps extra shortly.

2. The situation of your mission’s constructed Data.plist file:

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

As per Firebase crashlytics documentation, offering the situation of your mission’s constructed Data.plist file allows 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 submit, we realized about how can we use Firebase crashlytics in iOS app utilizing swift language. Given benefits offered by crashlytics to report crash inside app in a really descriptive method, it’s a really helpful factor to make use of within the cell app and many of the apps used it.



Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles