Firebase Crashlytics
Get crash reports for your app in Firebase Crashlytics, plus optional reports of your website's JavaScript errors, with opt-in and privacy controls.
Overview
The Firebase Crashlytics plugin sends crash reports for your app to Firebase, and can also report your website's JavaScript errors.
Setup
The same as Firebase Analytics: upload the Firebase files in the plugin settings, turn the plugin on in Integrations › Native plugins and build a new version. iPhone builds upload their debug symbols to Crashlytics automatically, so stack traces are readable.
From your page
wapp.crashlytics.setUserId('customer-42');
wapp.crashlytics.log('Checkout opened');
wapp.crashlytics.setAttribute({ key: 'cart_size', value: '3' });
try {
await submitOrder();
} catch (error) {
wapp.crashlytics.recordError({ message: error.message, name: error.name, stack: error.stack });
}
wapp.crashlytics.unsetUserId();Opt-in
Turn Send crash reports automatically off to send nothing until the user agrees (changing it needs a new build). Then:
wapp.crashlytics.enable(true); // after the user agreed
wapp.crashlytics.enable(false); // they changed their mindWebsite JavaScript errors
With Report website JavaScript errors on, these are sent as non-fatal "WebError" reports:
window.onerror- unhandled promise rejections
console.error
At most 20 are sent per page and 100 per session, and query strings are removed from file names. Your page can switch this at runtime with wapp.crashlytics.webErrorLogsEnabled(true) or (false). Show reported web errors on screen helps while testing.
Error messages can contain personal data. Do not put emails or tokens in errors you log.