Skip to content

Commit

Permalink
Update READE and fix logException()
Browse files Browse the repository at this point in the history
  • Loading branch information
ReallySmallSoftware committed Mar 2, 2018
1 parent 15545a4 commit c0ff459
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 52 deletions.
90 changes: 40 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,103 +1,93 @@
Cordova Firebase Crashlytics Plugin
==
# Cordova Firebase Crashlytics Plugin

A Google Firebase Crashlytics plugin to enable capture of crash reports.

What is Crashlytics?
--
# What is Crashlytics?

From the Google documentation (https://firebase.google.com/products/crashlytics/):

> Firebase Crashlytics helps you track, prioritize, and fix stability issues that erode app quality, in realtime. Spend less time triaging and troubleshooting crashes and more time building app features that delight users
Supported platforms
--
# Supported platforms
This plugin supports the following platforms:

- Android
- iOS (untested)
- Browser (for testing only)

Installation
--
# Installation

`cordova plugin add cordova-plugin-firestore --variable ANDROID_FIREBASE_VERSION=11.6.0 --save`
`cordova plugin add cordova-plugin-firebase-crashlytics --variable ANDROID_FIREBASE_VERSION=11.6.0 --save`

or

`phonegap plugin add cordova-plugin-firestore --variable ANDROID_FIREBASE_VERSION=11.6.0`
`phonegap plugin add cordova-plugin-firebase-crashlytics --variable ANDROID_FIREBASE_VERSION=11.6.0`

Omitting FIREBASE_VERSION will use a default value.
Omitting `FIREBASE_VERSION` will use a default value.

## Firebase configuration
### Android

Firebase configuration
--
Android
--
You must ensure that `google-services.json` is put in the correct location. This can be achieved using the following in your `config.xml`:

```
<platform name="android">
<resource-file src="google-services.json" target="google-services.json" />
</platform>
```
iOS
--
iOS requires `GoogleService-Info.plist` is put in the correct location. Similarly this can be done as follws:

#### Dependencies
##### cordova-support-google-services

In order to ensure Firebase initialises correctly on Android this plugin can be used. This is not automatically added as a dependency to allow for the configuration it performs to be done manually if desired.

### iOS
iOS requires `GoogleService-Info.plist` is put in the correct location. Similarly this can be done as follows:
```
<platform name="ios">
<resource-file src="GoogleService-Info.plist" />
</platform>
```

How to use it
--
Simply add the plugin to get the default Crashlytics functionality. Note that crashes and logged exceptions will only be reported when the app restarts.

Methods
==
# How to use it
Simply add the plugin to get the default Crashlytics functionality. Note that crashes and logged exceptions will only be reported when the application restarts.

crash()
--
Generate a forced crash.
## Methods
### crash()
Generate a forced crash. Visible in console after restart of application.

logPriority(priority, tag, message)
--
### logPriority(priority, tag, message)
Log a priority message. Will only be logged in the event of a crash.

log(message)
--
### log(message)
Log a message. Will only be logged in the event of a crash.

logException(message)
--
Log when a handled exception has happened.
### logException(message)
Log when a handled exception has happened. Visible in console after restart of application.

setString(key, value)
--
### setString(key, value)
Set extra key/value string value. Will only be logged in the event of a crash.

setBool(key, value)
--
### setBool(key, value)
Set extra key/value bool value. Will only be logged in the event of a crash.

setDouble(key, value)
--
### setDouble(key, value)
Set extra key/value double value. Will only be logged in the event of a crash.

setFloat(key, value)
--
### setFloat(key, value)
Set extra key/value float value. Will only be logged in the event of a crash.

setInt(key, value)
--
### setInt(key, value)
Set extra key/value integer value. Will only be logged in the event of a crash.

History
==
0.0.2
--
# History
## 0.0.3
- Fix typo in README
- Added embarrassing fix for logException()

## 0.0.2
- Add grunt to run jshint
- Fix some grunt warnings

0.0.1
--
## 0.0.1
- Initial release
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-firebase-crashlytics",
"version": "0.0.2",
"version": "0.0.3",
"cordova": {
"id": "cordova-plugin-firebase-crashlytics",
"platforms": [
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-firebase-crashlytics" version="0.0.2">
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-firebase-crashlytics" version="0.0.3">
<name>Cordova Firebase Crashlytics Plugin</name>
<description>Google Firebase Crashlytics</description>
<license>MIT</license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public void initialize(CordovaInterface cordova, CordovaWebView webView) {
handlers.put("setDouble", new SetDoubleHandler());
handlers.put("setFloat", new SetFloatHandler());
handlers.put("setInt", new SetIntHandler());
handlers.put("logException", new LogExceptionHandler());

Log.d(TAG, "Initializing FBCrashlyticsPlugin");

Expand Down

0 comments on commit c0ff459

Please sign in to comment.