All Projects → capacitor-community → firebase-crashlytics

capacitor-community / firebase-crashlytics

Licence: MIT License
⚡️ Capacitor plugin for Firebase Crashlytics.

Programming Languages

java
68154 projects - #9 most used programming language
swift
15916 projects
typescript
32286 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to firebase-crashlytics

capacitor-background-task
⚡️ Capacitor plugin for running background tasks.
Stars: ✭ 27 (-57.14%)
Mutual labels:  capacitor, capacitor-community
keep-awake
⚡️ Capacitor plugin to prevent devices from dimming or locking the screen.
Stars: ✭ 69 (+9.52%)
Mutual labels:  capacitor, capacitor-community
text-to-speech
⚡️ Capacitor plugin for synthesizing speech from text.
Stars: ✭ 50 (-20.63%)
Mutual labels:  capacitor, capacitor-community
capacitor-android-dark-mode-support
⚡️ Capacitor plugin to support dark mode on Android.
Stars: ✭ 23 (-63.49%)
Mutual labels:  capacitor, capacitor-community
native-xr-for-web
Add iOS and Android build with AR capabilities to your website or web-based app.
Stars: ✭ 27 (-57.14%)
Mutual labels:  capacitor
larasar
Laravel + Quasar Framework
Stars: ✭ 77 (+22.22%)
Mutual labels:  capacitor
ionic-vue-mobile-template-01
Hybrid app template built with vue, ionic and capacitor.
Stars: ✭ 47 (-25.4%)
Mutual labels:  capacitor
IonicMadrid
Charlas Ionic Madrid
Stars: ✭ 14 (-77.78%)
Mutual labels:  capacitor
tutorial-photo-gallery-vue
Photo Gallery Tutorial: Ionic Vue and Capacitor
Stars: ✭ 33 (-47.62%)
Mutual labels:  capacitor
capacitor-branch-deep-links
Capacitor plugin for branch.io deep links
Stars: ✭ 22 (-65.08%)
Mutual labels:  capacitor
ionic-vue-mobile-template-03
Hybrid app template built with vue, ionic and capacitor.
Stars: ✭ 62 (-1.59%)
Mutual labels:  capacitor
CrashlyticsKit
The most powerful, yet lightest weight crash reporting solution for Unreal Engine 4
Stars: ✭ 25 (-60.32%)
Mutual labels:  crashlytics
capacitor-vue-ionicv4-app
sample app using capacitor vuejs and ionicv4 components
Stars: ✭ 70 (+11.11%)
Mutual labels:  capacitor
firebase
Modular Firebase 🔥 implementation for NativeScript. Supports both iOS & Android platforms for all Firebase services.
Stars: ✭ 36 (-42.86%)
Mutual labels:  crashlytics
appcenter-sdk-capacitor
Capacitor Plugin for Microsoft's Visual Studio App Center SDK.
Stars: ✭ 22 (-65.08%)
Mutual labels:  capacitor
ionic-firebase-image-upload
Building an Ionic App with Protected/Private Content. This app shows how to use Firebase Storage from an Ionic Angular app both with public and private content.
Stars: ✭ 19 (-69.84%)
Mutual labels:  capacitor
capacitor-firebase-authentication
⚡️ Capacitor plugin for Firebase Authentication.
Stars: ✭ 67 (+6.35%)
Mutual labels:  capacitor
firebase-analytics
Enable Firebase Analytics for Capacitor Apps
Stars: ✭ 123 (+95.24%)
Mutual labels:  capacitor
v-cupertino
A Vue 3 Wrapper for Cupertino Pane Library
Stars: ✭ 17 (-73.02%)
Mutual labels:  capacitor
cordova-plugin-apkupdater
This plugin allows your Android app to download and install compressed updates without the Google Play Store.
Stars: ✭ 46 (-26.98%)
Mutual labels:  capacitor


Firebase Crashlytics

@capacitor-community/firebase-crashlytics

Capacitor plugin for Firebase Crashlytics.


Maintainers

Maintainer GitHub Social
Robin Genz robingenz @robin_genz

Installation

npm install @capacitor-community/firebase-crashlytics
npx cap sync

Add Firebase to your project if you haven't already (Android / iOS).

Android

See Add the Firebase Crashlytics plugin to your app and follow the instructions to set up your app correctly.

Variables

This plugin will use the following project variables (defined in your app’s variables.gradle file):

  • $firebaseCrashlyticsVersion version of com.google.firebase:firebase-crashlytics (default: 18.2.8)

iOS

See Set up Xcode to automatically upload dSYM files and follow the instructions to set up Xcode correctly.
Attention: The path used in section 4.c of the guide should be:

"${PODS_ROOT}/FirebaseCrashlytics/run"

Configuration

No configuration required for this plugin.

Demo

A working example can be found here: robingenz/capacitor-firebase-plugin-demo

Usage

import { FirebaseCrashlytics } from '@capacitor-community/firebase-crashlytics';

const crash = async () => {
  await FirebaseCrashlytics.crash({ message: 'Test' });
};

const setContext = async () => {
  await FirebaseCrashlytics.setContext({ 
    key: 'page',
    value: 'home',
    type: 'string'
  });
};

const setUserId = async () => {
  await FirebaseCrashlytics.setUserId({
    userId: '123'
  });
};

const addLogMessage = async () => {
  await FirebaseCrashlytics.addLogMessage({
    message: 'Test'
  });
};

const setEnabled = async () => {
  await FirebaseCrashlytics.setEnabled({
    enabled: true,
  });
};

const isEnabled = async () => {
  const result = await FirebaseCrashlytics.isEnabled();
  return result.enabled;
};

const didCrashDuringPreviousExecution = async () => {
  const result = await FirebaseCrashlytics.didCrashDuringPreviousExecution();
  return result.crashed;
};

const sendUnsentReports = async () => {
  await FirebaseCrashlytics.sendUnsentReports();
};

const deleteUnsentReports = async () => {
  await FirebaseCrashlytics.deleteUnsentReports();
};

const recordException = async () => {
  await FirebaseCrashlytics.recordException({
    message: 'This is a non-fatal message.'
  });
};

import * as StackTrace from 'stacktrace-js';

const recordExceptionWithStacktrace = async (error: Error) => {
    const stacktrace = await StackTrace.fromError(error);
    await FirebaseCrashlytics.recordException({
        message: 'This is a non-fatal message.',
        stacktrace
    });
};

API

crash(...)

crash(options: { message: string; }) => Promise<void>

Forces a crash to test the implementation.

Only available for Android and iOS.

Param Type
options { message: string; }

setContext(...)

setContext(options: ContextOptions) => Promise<void>

Sets a custom key and value that is associated with subsequent fatal and non-fatal reports.

Only available for Android and iOS.

Param Type
options ContextOptions

setUserId(...)

setUserId(options: { userId: string; }) => Promise<void>

Sets a user ID (identifier) that is associated with subsequent fatal and non-fatal reports.

Only available for Android and iOS.

Param Type
options { userId: string; }

addLogMessage(...)

addLogMessage(options: { message: string; }) => Promise<void>

Adds a log message that is sent with your crash data. Only visible in the Crashlytics dashboard.

Only available for Android and iOS.

Param Type
options { message: string; }

setEnabled(...)

setEnabled(options: { enabled: boolean; }) => Promise<void>

Enables/disables automatic data collection. The value does not apply until the next run of the app.

Only available for Android and iOS.

Param Type
options { enabled: boolean; }

isEnabled()

isEnabled() => Promise<{ enabled: boolean; }>

Returns whether or not automatic data collection is enabled.

Only available for iOS.

Returns: Promise<{ enabled: boolean; }>


didCrashDuringPreviousExecution()

didCrashDuringPreviousExecution() => Promise<{ crashed: boolean; }>

Returns whether the app crashed during the previous execution.

Only available for Android and iOS.

Returns: Promise<{ crashed: boolean; }>


sendUnsentReports()

sendUnsentReports() => Promise<void>

Uploads any unsent reports to Crashlytics. When automatic data collection is enabled, Crashlytics automatically uploads reports at startup.

Only available for Android and iOS.


deleteUnsentReports()

deleteUnsentReports() => Promise<void>

Deletes any unsent reports on the device.

Only available for Android and iOS.


recordException(...)

recordException(options: RecordExceptionOptions) => Promise<void>

Records a non-fatal report to send to Crashlytics.

Only available for Android and iOS.

Param Type
options RecordExceptionOptions

Interfaces

ContextOptions

Prop Type
key string
value string | number | boolean
type 'string' | 'boolean' | 'long' | 'double' | 'int' | 'float'

RecordExceptionOptions

Prop Type Description
message string
code number Error code within a specific error domain. This option is ignored when stacktrace is provided. Only available for iOS.
domain string A string containing the error domain. This option is ignored when stacktrace is provided. Only available for iOS.
stacktrace StackFrame[] A stacktrace generated by stacktrace.js. Cannot be combined with code and domain.

StackFrame

Subset of the Stacktrace generated by stacktrace.js.

Prop Type
lineNumber number
fileName string
functionName string

Test your implementation

Here you can find more information on how to test the Firebase Crashlytics implementation. Among other things, you will find information on how to correctly adjust the project's debug settings under iOS and how to test it out.

If you get obfuscated crash reports for iOS, make sure you have initialized Crashlytics correctly and take a look at this guide, which provides some ways to troubleshoot if Crashlytics can't find your app's dSYM.

Changelog

See CHANGELOG.md.

License

See LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].