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

cordova-firebase-plugin

v1.2.0

Published

A cordova plugin that wraps the Firebase SDK with an easy to use api.

Downloads

74

Readme

Cordova Firebase Plugin

This plugin wraps the Firebase remote config, performance, analytics, crashlytics, messaging, and authentication SDK with an easy to use api and detailed documentation. Follow the below instructions for iOS setup and plugin use.

Supported Cordova Versions

  • cordova: >=6.0.0 and <=8.1.2
  • cordova-ios: >=4.0.0 and <=5.0.0

Plugin Dependency

  • cordova-sqlite-storage: >=3.2.1

Setup Firebase

  1. Create a Firebase account if you don't already have one
  2. View Firebase setup on how to add an app.
  3. Add an ios app.
  4. Register the app in step 1 of the prompt
  5. Download the config file for later use.
  6. Skip step 3 and 4 of the prompt
  7. Leave the browser open on step 5 and continue to the Project Setup below.

Project Setup for the Plugin

Install the above plugin dependency if you don't already have it installed. Place your Firebase configuration file (GoogleService-Info.plist) into the root folder of your project. View Firebase support for details on how to download the file if you did not download it in the above Firebase Setup.

- My Project/
    platforms/
    plugins/
    www/
    config.xml
    GoogleService-Info.plist   <--
    ...

Install the Plugin

Install the plugin with this command:

cordova plugin add cordova-firebase-plugin --save

or for Ionic this command:

ionic cordova plugin add cordova-firebase-plugin

or add this to your config.xml:

<plugin name="cordova-firebase-plugin" spec="1.2.0" />

Build the app and it will be added to Firebase

  1. Build your app and run it with Xcode on a conected device or simulator
  2. Click the stop button on Xcode and then press the play button
  3. The opened Firebase tab from the above Firebase Setup should pick up the app activation
  4. If Firebase does not give a success message then uninstall the app from the simulator or connected device and then repeat steps 1-4

Crashlytics Setup

  1. Open Firebase Crashlytics in your browser after adding your app to Firebase successfully via the above app build process
  2. Click "Setup Crashlytics"
  3. Select "No, Setup a new Firebase app
  4. Click "Go to Crashlytics Docs"
  5. Navigate back to the Firebase Crashlytics tab on your browser
  6. Build your app and run it with Xcode on a connected device or simulator
  7. Click the stop button on Xcode and then press the play button
  8. The opened Firebase Crashlytics tab in your browser should pick up the app activation
  9. If Crashlytics does not give a success message then uninstall the app from the simulator or connected device and then repeat steps 6-8. If this does not work then proceed to "How to send a test crash"

How to send a test crash

CordovaFirebasePlugin.reportNonFatalCrash("Test Error Name", "Test Error Message", "Test Error URL", "Test Error Stacktrace")

Build the app, run it with Xcode on a device/simulator, press stop in Xcode, reopen the app, run the above crash report code, exit the app, remove it from the background, and then reopen it to send the test crash.

PhoneGap

You will have to manually place your configuration file in the platforms/ios/My Project/Resources folder of your project and hard code the app id and api key in plugin.xml.

How to use the plugin

The plugin currently does not have typings.

  • Place this code before the @Component in typescript:
declare var CordovaFirebasePlugin: any;
  • Place this code before any other code in a javascript/jquery mobile app
var CordovaFirebasePlugin;
  • Example use in an application:
CordovaFirebasePlugin.setAnalyticsScreenName("Login");
CordovaFirebasePlugin.setCrashlyticsUserID("123");
CordovaFirebasePlugin.setAnalyticsUserID("123");
CordovaFirebasePlugin.reportEvent("Login_Success", {timestamp:new Date()} );
CordovaFirebasePlugin.setAnalyticsUserProperty("Role", "Admin");
  • Example Crashlytics reporting of Javascript/Typescript errors:
CordovaFirebasePlugin.reportNonFatalCrash("errorName", "errorMessage", "errorUrl", "stackTrace");

Note

  • Check out the CordovaFirebasePlugin.js file for more commands

Note

  • Native errors will be caught and reported automatically to Crashlytics
  • Javascript/Non-fatal errors will be categorized and grouped, in Crashlytics, by the length of the error