UNPKG

react-native-crash-handler

Version:

A ReactNatice Crash Handler for android, not ios

38 lines (25 loc) 1.04 kB
# 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 1. 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 the `getPackages()` method 2. 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') ``` 3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: ``` compile project(':react-native-crash-handler') ``` ## Usage ```javascript import RNCrashHandler from 'react-native-crash-handler'; // TODO: What to do with the module? RNCrashHandler; ```