react-native-cf-bugly
v0.0.2
Published
TODO
Downloads
26
Readme
react-native-cf-bugly
Getting started
$ yarn add react-native-cf-bugly
Usage
Install
Android:
在Module的build.gradle文件中添加依赖和属性配置:
android {
defaultConfig {
ndk {
// 设置支持的SO库架构
abiFilters 'armeabi' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
}
}
}
在AndroidManifest.xml中添加权限:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
请避免混淆Bugly,在Proguard混淆文件中增加以下配置:
-dontwarn com.tencent.bugly.**
-keep public class com.tencent.bugly.**{*;}
Tips:
建议在Module的build.gradle文件中使用NDK的“abiFilter”配置,设置支持的SO库架构。
如果在添加“abiFilter”之后Android Studio出现以下提示:
NDK integration is deprecated in the current plugin. Consider trying the new experimental plugin.
则在项目根目录的gradle.properties文件中添加:
android.useDeprecatedNdk=true
使用
import CfBugly from 'react-native-cf-bugly';
cfBugly.buglyInit({appid: Platform.select(accounts.bugly) as string});
//上报自定义异常
cfBugly.reportException(err: string);