dan.oy
dan.oy

Reputation: 41

Ionic App | Firebase Crashlytics does not work with Crash Reporting?

I'm using @ionic-native/firebase plugin in our Ionic App, and crash reporting is included in this plugin. Since Firebase Crash Reporting will no longer be accessible after September 9, we are trying to switch to Firebase Crashlytics. But we're not getting any crash data on Crashlytics dashboard. Here's what I've tried:

My question is: does crashlytics not work when crash reporting is used in the App? Or did I implement crashlytics wrong? Any help would be appreciated.

Upvotes: 4

Views: 4583

Answers (3)

Sampath
Sampath

Reputation: 65870

You can use the Sentry Capacitor plugin here.

Sentry's Capacitor SDK enables automatic reporting of errors, exceptions, and messages. It includes native crash support on iOS and Android.

Official doc: https://docs.sentry.io/platforms/javascript/guides/capacitor/

Upvotes: 0

Stewan
Stewan

Reputation: 31

For those who are stuck with cordova , try get capacitor (which also supports cordova out-of-box)

There’s a plugin for crashlytics

enter image description here

once you got the stuff set up you'll only have to

import { Crashlytics } from 'capacitor-crashlytics';
const crashlytics = new Crashlytics();

//
// log user
crashlytics
  .logUser({
    name: "John Doe",
    email: "[email protected]",
    id: "123"
  })
  .then(() => alert(`user logged`))
  .catch(err => alert(err.message));

//
// force a crash
crashlytics.crash();

Check this out to learn more

https://github.com/stewwan/capacitor-crashlytics

side note: I’m the creator, feel free to PR or file issues.

Upvotes: 3

Kishan Oza
Kishan Oza

Reputation: 1735

Finally I found my mistake. I am using cordova-plugin-firebase and to check the crash I am using the logEvent and logError method of that plugin ttlo check whether it is reflecting to console or not but I for the first time I am not able to see any of the log.. I waited like 24 hours but then I read the documentation about the Non-Fatal error here and check the Firebase-plugin.java and come to conclution that this 2 methods are basically logging the non-fatal error so you have to apply filter in firebase console to see you manual logs like this.. enter image description here

And when you app actually crashed by any reason you will defnalty see the logs in Crashes section..

Upvotes: 1

Related Questions