Crasheye react native module.
Base on:
- Crasheye Android SDK 2.2.1
- Crasheye iOS SDK 2.5.1
More infomation: http://www.crasheye.cn/sdk
$ npm install react-native-crasheye --save
$ react-native link react-native-crasheye
You should add crasheye SDK to your iOS project. Official tutorial is here.
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-crasheye
and addRNCrasheye.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNCrasheye.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Add crasheye SDK to your iOS project. Official tutorial is here.
- Run your project (
Cmd+R
)
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.cooclsee.crasheye.RNCrasheyePackage;
to the imports at the top of the file - Add
new RNCrasheyePackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-crasheye' project(':react-native-crasheye').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-crasheye/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-crasheye')
import Crasheye from 'react-native-crasheye';
Crasheye.init({
appKey: 'your appKey', // required
channelID: '', // option
appVersion: '', // option
flushOnlyOverWiFi: false, // default false
userIdentifier: '', // option
logging: {
lines: 1000, // option, less than 1000
filter: '', // option
}
});
Crasheye.getSDKVersion()
.then(ver => console.log(ver));
// or
let ver = await Crasheye.getSDKVersion();
Crasheye.getDeviceId()
.then(deviceId => console.log(deviceId));
// or
let deviceId = await Crasheye.getDeviceId();
Crasheye.leaveBreadcrumb('the breadcrumb content');
Crasheye.sendScriptException('errorTitle', 'exception content');
Crasheye.addExtraData('key', 'value');