Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@capacitor-firebase/crashlytics
Advanced tools
Unofficial Capacitor plugin for Firebase Crashlytics.1
npm install @capacitor-firebase/crashlytics
npx cap sync
Add Firebase to your project if you haven't already (Android / iOS).
See Add the Firebase Crashlytics plugin to your app and follow the instructions to set up your app correctly.
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.6.2
)To generate human readable crash reports, Crashlytics needs your project's debug symbol (dSYM) files. The following steps describe how to automatically upload dSYM files to Firebase whenever you build your app:
debug information format
.DWARF with dSYM File
for all your build types."${PODS_ROOT}/FirebaseCrashlytics/run"
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}
$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
No configuration required for this plugin.
A working example can be found here: robingenz/capacitor-firebase-plugin-demo
The following starter templates are available:
import { FirebaseCrashlytics } from '@capacitor-firebase/crashlytics';
const crash = async () => {
await FirebaseCrashlytics.crash({ message: 'Test' });
};
const setCustomKey = async () => {
await FirebaseCrashlytics.setCustomKey({
key: 'page',
value: 'home',
type: 'string',
});
};
const setUserId = async () => {
await FirebaseCrashlytics.setUserId({
userId: '123',
});
};
const log = async () => {
await FirebaseCrashlytics.log({
message: 'Test',
});
};
const setEnabled = async () => {
await FirebaseCrashlytics.setEnabled({
enabled: true,
});
};
const isEnabled = async () => {
const { enabled } = await FirebaseCrashlytics.isEnabled();
return enabled;
};
const didCrashOnPreviousExecution = async () => {
const { crashed } = await FirebaseCrashlytics.didCrashOnPreviousExecution();
return 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,
});
};
crash(...)
setCustomKey(...)
setUserId(...)
log(...)
setEnabled(...)
isEnabled()
didCrashOnPreviousExecution()
sendUnsentReports()
deleteUnsentReports()
recordException(...)
crash(options: CrashOptions) => Promise<void>
Forces a crash to test the implementation.
Only available for Android and iOS.
Param | Type |
---|---|
options | CrashOptions |
Since: 0.1.0
setCustomKey(options: SetCustomKeyOptions) => 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 | SetCustomKeyOptions |
Since: 0.1.0
setUserId(options: SetUserIdOptions) => 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 | SetUserIdOptions |
Since: 0.1.0
log(options: LogOptions) => Promise<void>
Adds a custom log message that is sent with your crash data to give yourself more context for the events leading up to a crash.
Only available for Android and iOS.
Param | Type |
---|---|
options | LogOptions |
Since: 0.1.0
setEnabled(options: SetEnabledOptions) => 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 | SetEnabledOptions |
Since: 0.1.0
isEnabled() => Promise<IsEnabledResult>
Returns whether or not automatic data collection is enabled.
Only available for iOS.
Returns: Promise<IsEnabledResult>
Since: 0.1.0
didCrashOnPreviousExecution() => Promise<DidCrashOnPreviousExecutionResult>
Returns whether the app crashed during the previous execution.
Only available for Android and iOS.
Returns: Promise<DidCrashOnPreviousExecutionResult>
Since: 0.1.0
sendUnsentReports() => Promise<void>
Uploads any unsent reports to Crashlytics at next startup.
When automatic data collection is enabled, Crashlytics automatically uploads reports at startup.
Only available for Android and iOS.
Since: 0.1.0
deleteUnsentReports() => Promise<void>
Deletes any unsent reports on the device.
Only available for Android and iOS.
Since: 0.1.0
recordException(options: RecordExceptionOptions) => Promise<void>
Records a non-fatal report to send to Crashlytics.
Only available for Android and iOS.
Param | Type |
---|---|
options | RecordExceptionOptions |
Since: 0.1.0
Prop | Type | Since |
---|---|---|
message | string | 0.1.0 |
Prop | Type | Since |
---|---|---|
key | string | 0.1.0 |
value | string | number | boolean | 0.1.0 |
type | 'string' | 'boolean' | 'long' | 'double' | 'int' | 'float' | 0.1.0 |
Prop | Type | Since |
---|---|---|
userId | string | 0.1.0 |
Prop | Type | Since |
---|---|---|
message | string | 0.1.0 |
Prop | Type | Since |
---|---|---|
enabled | boolean | 0.1.0 |
Prop | Type | Since |
---|---|---|
enabled | boolean | 0.1.0 |
Prop | Type | Since |
---|---|---|
crashed | boolean | 0.1.0 |
Prop | Type | Description | Since |
---|---|---|---|
message | string | 0.1.0 | |
code | number | Error code within a specific error domain. Only available for iOS. | 0.1.0 |
domain | string | A string containing the error domain. Only available for iOS. | 0.1.0 |
stacktrace | StackFrame[] | A stacktrace generated by stacktrace.js. Cannot be combined with code and domain . | 1.1.0 |
Subset of the Stacktrace generated by stacktrace.js.
Prop | Type |
---|---|
lineNumber | number |
fileName | string |
functionName | string |
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.
See CHANGELOG.md.
See LICENSE.
This plugin is based on the Capacitor Community Firebase Crashlytics plugin. Thanks to everyone who contributed to the project!
This project is not affiliated with, endorsed by, sponsored by, or approved by Google LLC or any of their affiliates or subsidiaries. ↩
FAQs
Capacitor plugin for Firebase Crashlytics.
The npm package @capacitor-firebase/crashlytics receives a total of 9,480 weekly downloads. As such, @capacitor-firebase/crashlytics popularity was classified as popular.
We found that @capacitor-firebase/crashlytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.