5

I am working on react-native-firebase crashlytics. I am using rnfirebase starter kit. There we have crashlytics integrated with the project. Now, I want to crash my app to check the crash report.

Sadhu
  • 850
  • 2
  • 9
  • 18

4 Answers4

7

You need to import packages react-native-fabric and another line in initial file.

    import Fabric from 'react-native-fabric';
    var { Crashlytics } = Fabric;
    Crashlytics.crash();
Hardik Virani
  • 1,687
  • 7
  • 23
  • 36
7

It is now:

import crashlytics from '@react-native-firebase/crashlytics';

then

crashlytics().crash()

https://rnfirebase.io/crashlytics/usage

TechnoTim
  • 3,065
  • 1
  • 23
  • 28
4

You need to need to import the crashlytics and use crash() to do a manual crash.

import crashlytics from 'react-native-fabric-crashlytics';

Calling the code below should crash your application:

crashlytics().crash();
mysl
  • 1,003
  • 2
  • 9
  • 19
Nirmalsinh Rathod
  • 5,079
  • 4
  • 26
  • 56
0

You can import crashlytics and use crash() to do a native crash.

import crashlytics from 'react-native-fabric-crashlytics';
crashlytics().crash();
Scinfu
  • 1,081
  • 13
  • 18