Google Firebase Crashlytics

Firebase Crashlytics is a real-time crash reporter that helps developers track, prioritize, and fix stability issues in their apps

Firebase Crashlytics is a real-time crash reporting solution that helps you identify, prioritize, and resolve the most critical issues affecting your app users. This plugin integrates the iOS and Android Firebase Crashlytics SDKs into your app and supports logging of the following event types:

  • App crash events
  • WebView console errors
  • Android toast errors (e.g., SSL certificate warnings) - Android only

👍

Developer Demo

Display our demo page in your app to test during development https://median.dev/crashlytics

Plugin Configuration

Enable Firebase Crashlytics Plugin

Once you have purchased the plugin, open your app in Median's App Studio and go to the Native Plugins section. Select Google Firebase Crashlytics from your list of purchased plugins and enable it as seen below:

Figure 3: Enable Google Firebase Crashlytics on App Studio

Enable Firebase Crashlytics in App Studio

Configure Log Collection Options

To customize which logs are collected:

  1. Click Advanced Mode.
  2. Toggle the following options:
    1. webErrorLogsEnabled: Enable/disable WebView console error collection.
    2. toastErrorLogsEnabled: Enable/disable Android toast error collection.
    3. requestOptIn: Enable/disable consent prompt for log collection.
Figure 2: Enable/Disable specific logs

Enable or disable specific log types

App Configuration

  1. Register your app in the Firebase Console.
  2. Download the following files:
    1. iOS: GoogleService-Info.plist
    2. Android: google-services.json
  3. Upload the GoogleService-Info.plist (iOS) and google-services.json (Android) in the Build & Download > Google Services setting. You can upload the files provided from Firebase directly or open the file and copy & paste its contents into the App Studio.
Upload your GoogleService-Info.plist and google-services.json configurations

Upload your GoogleService-Info.plist and google-services.json configurations

For full instructions, refer to the official Firebase setup guides:

🏁

Finalizing the App Build

Once the configuration files are uploaded please ensure that you save the changes and rebuilt your app.

JavaScript Bridge Implementation Guide

The Median JavaScript Bridge allows you to control Crashlytics at runtime.

Enable/Disable logs collection

↔️Median JavaScript Bridge

// Enable/disable Crashlytics
median.firebaseCrashlytics.enable(true);
median.firebaseCrashlytics.enable(false);

// WebView error logging
median.firebaseCrashlytics.webErrorLogsEnabled(true);
median.firebaseCrashlytics.webErrorLogsEnabled(false);

// Toast error logging (Android only)
median.firebaseCrashlytics.toastErrorLogsEnabled(true);
median.firebaseCrashlytics.toastErrorLogsEnabled(false);

Set unique ID for each user

Use a custom user ID to track crash logs per user in Firebase.

Note: User IDs persist between app launches but are cleared if the app is uninstalled or reinstalled.

↔️Median JavaScript Bridge

median.firebaseCrashlytics.setUserId('user_123'); // Assign user ID
median.firebaseCrashlytics.unsetUserId();         // Remove user ID

Optional: Request User Consent for Log Collection

To comply with privacy policies or regulations, you can ask users for permission before collecting logs. You can enable the permission prompt by setting requestOptIn to true as shown in the plugin configuration.

Users will see a permission dialog on first app launch post-installation as shown below:

Figure 3: Request Collection Opt-In

Request user opt-in for log collection