npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gartorware/cordova-plugin-firebase-crash

v7.0.7

Published

Cordova plugin for Firebase Crashlytics

Downloads

4

Readme

Cordova plugin for Firebase Crashlytics

NPM version NPM downloads NPM total downloads PayPal donate Twitter

| Donate | Your help is appreciated. Create a PR, submit a bug or just grab me :beer: | |-|-|

Index

Supported Platforms

  • iOS
  • Android

Installation

$ cordova plugin add cordova-plugin-firebase-crash

If you get an error about CocoaPods being unable to find compatible versions, run

$ pod repo update

Use variables IOS_FIREBASE_POD_VERSION ANDROID_FIREBASE_BOM_VERSION to override dependency versions for Firebase SDKs:

$ cordova plugin add cordova-plugin-firebase-crash \
    --variable IOS_FIREBASE_POD_VERSION="9.3.0" \
    --variable ANDROID_FIREBASE_BOM_VERSION="30.3.1"

Disable data collection

In some cases, you may wish to temporarily or permanently disable collection of crash data. You can set the value of variable CRASHLYTICS_COLLECTION_ENABLED to false to prevent collecting any user data:

$ cordova plugin add cordova-plugin-firebase-crash \
    --variable CRASHLYTICS_COLLECTION_ENABLED=false

Later you can re-enable crashlytics (for instance after getting end-user consent) using method setEnabled.

Adding required configuration files

Cordova supports resource-file tag for easy copying resources files. Firebase SDK requires google-services.json on Android and GoogleService-Info.plist on iOS platforms.

  1. Put google-services.json and/or GoogleService-Info.plist into the root directory of your Cordova project
  2. Add new tag for Android platform
<platform name="android">
    ...
    <resource-file src="google-services.json" target="app/google-services.json" />
</platform>
...
<platform name="ios">
    ...
    <resource-file src="GoogleService-Info.plist" />
</platform>

This way config files will be copied on cordova prepare step.

Functions

log(message): Promise<void>

Add logging that will be sent with your crash data in case of app crash.

See

https://firebase.google.com/docs/crashlytics/customize-crash-reports?authuser=0#add_custom_log_messages

Example

cordova.plugins.firebase.crashlytics.log("my custom log message");

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | message | string | Log message |

Returns

Promise<void>

Callback when operation is completed

logError(message): Promise<void>

Log non-fatal exceptions in addition to automatically reported app crashes.

See

https://firebase.google.com/docs/crashlytics/customize-crash-reports?authuser=0#log_non-fatal_exceptions

Example

cordova.plugins.firebase.crashlytics.logError("my non-fatal exception message");

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | message | string | Log message |

Returns

Promise<void>

Callback when operation is completed

setCustomKey(key, value): Promise<void>

Add custom key/value pairs to crashlytics report.

See

https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=android

Example

cordova.plugins.firebase.crashlytics.setCustomKey("my-string-key", "test value");
cordova.plugins.firebase.crashlytics.setCustomKey("my-number-key", 123);
cordova.plugins.firebase.crashlytics.setCustomKey("my-boolean-key", true);

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | key | string | Name of the custom key | | value | string | number | boolean | Value of the custom key |

Returns

Promise<void>

Callback when operation is completed

setEnabled(enabled): Promise<void>

Sets whether crashlytics collection is enabled for this app on this device.

Example

cordova.plugins.firebase.crashlytics.setEnabled(false);

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | enabled | boolean | Flag that specifies new state |

Returns

Promise<void>

Callback when operation is completed

setUserId(userId): Promise<void>

Sets the user identifier property for crashlytics reporting.

See

https://firebase.google.com/docs/crashlytics/customize-crash-reports?authuser=0#set_user_identifiers

Example

cordova.plugins.firebase.crashlytics.setUserId("12345");

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | userId | string | User's indentifier string |

Returns

Promise<void>

Callback when operation is completed