Skip to content

verheyefrancesco/cordova-plugin-crashlytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crashlytics Plugin for Cordova/PhoneGap 3.0 (iOS and Android)

Alt text Alt text

Installation

  1. Make sure that you have Node and Cordova CLI or PhoneGap's CLI installed on your machine.

  2. Add Crashlytics plugin (IDE plugin) to the Android / iOS project https://www.crashlytics.com/downloads

  3. Create a native crash. Go to step 4 if you can see the crash report on the dashboard.

  4. Add a plugin to your project using Cordova CLI:

cordova plugin add https://github.com/francescobitmunks/cordova-plugin-crashlytics

Or using PhoneGap CLI:

phonegap local plugin add https://github.com/francescobitmunks/cordova-plugin-crashlytics

Usage

function sendCrashWithData() {
	crashlyticsPlugin.setUserIdentifier('TheIdentifier');
    crashlyticsPlugin.setUserName('Francesco Verheye');
    crashlyticsPlugin.setUserEmail('verheye.francesco@gmail.com');

    crashlyticsPlugin.setStringValueForKey('MyString', 'stringkey');
    crashlyticsPlugin.setIntValueForKey(200, 'intkey');
    crashlyticsPlugin.setBoolValueForKey(true, 'boolkey');
    crashlyticsPlugin.setFloatValueForKey(1.5, 'floatkey');

    crashlyticsPlugin.addLog('This my a log message from JS!');
    crashlyticsPlugin.addLog('This is another log message from JS!');
    //ios
    crashlyticsPlugin.sendCrash();
    
    //android
    crashlyticsPlugin.sendCrash('my crash');
    crashlyticsPlugin.sendNonFatalCrash('my non-fatal error');
}

Methods

setUserIdentifier(value) - iOS, Android

Set the user identifier value

setUserName(value) - iOS, Android

Set the username

setUserEmail(value) - iOS, Android

Set the user email

setStringValueForKey(value, key) - iOS, Android

Set String value for key

setIntValueForKey(value, key) - iOS, Android

Set integer value for key

setBoolValueForKey(value, key) - iOS, Android

Set boolean for key

setFloatValueForKey(value, key) - iOS, Android

Set float for key

addLog(value) - iOS, Android

Add log for the crash.

sendCrash() - iOS

Send a (fatal) crash to the backand of CrashLytics.

sendCrash(exceptionMessage) - Android

Send a (fatal) crash to the backand of CrashLytics.

sendNonFatalCrash(exceptionMessage) - Android

Send a non-fatal crash to the backand of CrashLytics.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published