README
react-native-crash-handler
Getting started
$ npm install react-native-crash-handler --save
Mostly automatic installation
$ react-native link react-native-crash-handler
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.cmcm.crashhandler.RNCrashHandlerPackage;
to the imports at the top of the file - Add
new RNCrashHandlerPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-crash-handler' project(':react-native-crash-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-crash-handler/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-crash-handler')
Usage
import RNCrashHandler from 'react-native-crash-handler';
// TODO: What to do with the module?
RNCrashHandler;