react-native-crash-handler

A ReactNatice Crash Handler for android, not ios

Usage no npm install needed!

<script type="module">
  import reactNativeCrashHandler from 'https://cdn.skypack.dev/react-native-crash-handler';
</script>

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

  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
  1. 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')
    
  2. 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;