Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Integrate Crashlytics with React Native app

I'm building my app using React Native and I want to catch crashes that happen on both Objective-C and JavaScript sides of the app.

I installed Crashlytics SDK using their guide and installer and everything went smooth. I do get to see crashes from the Objective-C side, but not crashes that occurs from JavaScript.

Do I need to do something special to catch JavaScript errors and report them to Crashlytics?

Thanks, Ran.

like image 245
Ran Yefet Avatar asked Jan 12 '16 09:01

Ran Yefet


People also ask

How to install React Native Firebase Crashlytics on Android?

Install the following react native firebase crashlytics dependencies Click on the android icon on the firebase dashboard to setup application Write your app name and register 2. Download the google-services.json file and put it on your — projectname/android/app — folder.

How does Crashlytics work in React Native?

React Native Crashlytics module by default installs a global javascript exception handler, and it records a crash with a javascript stack trace any time an unhandled javascript exception is thrown.

How to get started with React Native?

Getting started with React Native will help you to know more about the way you can make a React Native project. We are going to use react-native init to make our React Native App. Assuming that you have node installed, you can use npm to install the react-native-cli command line utility. Open the terminal and go to the workspace and run

What is recorderror API in React Native Crashlytics?

React Native Crashlytics provides you with the recordError API to help record these errors. This API records the stack trace and the information it captures during a fatal crash. You can view these in the Firebase console as well.


2 Answers

I just wrote a blog post about this:

Add Crashlytics to your React Native iOS app

The approach I took was to override the logging function of react native to be able to log my own stuff and see it on the crash logs and also generated a sourcemap in order to the see full stack trace.

like image 120
brunobar79 Avatar answered Oct 05 '22 22:10

brunobar79


You could use react-native-fabric It has a good guide and has js methods for both crashlytics and answer

like image 38
Ismail Iqbal Avatar answered Oct 05 '22 23:10

Ismail Iqbal