Reputation: 41
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:
First, I followed Get started with Firebase Crashlytics, built and ran our App. Then I found I could access Crashlytics dashboard, which I thought the SDK was implemented successfully. But after I crashed the app for a few times and waited for at least one day, but nothing showed up on either Crash Reporting or Crashlytics dashboard.
Then, I reversed the changes made to our app and built & ran again, firebase console didn't change back. I found this plugin cordova-plugin-firebase-crash and installed it to my app successfully. After crashing the app, almost immediately I got the crash data on Crash Reporting dashboard but no crashes on Crashlytics dashboard, but I could see the change on Crash-free statistics graph, which is weird. Now the Crashlytics dashboard looks like this:Crashlytics dashboard .
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
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
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
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
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..
And when you app actually crashed by any reason you will defnalty see the logs in Crashes
section..
Upvotes: 1