-
Make sure that you have Node and Cordova CLI or PhoneGap's CLI installed on your machine.
-
Add Crashlytics plugin (IDE plugin) to the Android / iOS project https://www.crashlytics.com/downloads
-
Create a native crash. Go to step 4 if you can see the crash report on the dashboard.
-
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
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!');
crashlyticsPlugin.sendCrash();
}
Set the user identifier value
Set the username
Set the user email
Set String value for key
Set integer value for key
Set boolean for key
Set float for key
Add log for the crash.
Send a (fatal) crash to the backand of CrashLytics.