npm i --save nativescript-bugsee
- 版本: 0.1.0
- GitHub:
- NPM: https://npmjs.net.cn/package/nativescript-bugsee
- 下载量
- 昨天: 0
- 上周: 0
- 上个月: 0
Bugsee for NativeScript
此插件将 Bugsee 支持添加到您的 NativeScript 应用程序中。记录应用崩溃前最后 30 秒的内容。允许用户通过摇晃或截图应用来提交错误。
安装
要安装插件,请执行以下操作
tns plugin add nativescript-bugsee
使用方法
iOS
将以下内容放入您的主要应用 JS 文件中
// Replace this with your actual token
Bugsee.launchWithToken('0000000-0000-0000-0000-00000000000')
Android
这稍微复杂一些,因为它需要扩展主 Application 类。
在 app/application.android.js 中创建此文件
(将 yourApplicationName 替换为您的应用名称,将 token 替换为您的 Android token)
/* global android com */
const superProto = android.app.Application.prototype
const Bugsee = com.bugsee.library.Bugsee
// the first parameter of the `extend` call defines the package and the name for the native *.JAVA file generated.
android.app.Application.extend('org.yourApplicationName.Application', {
onCreate: function () {
superProto.onCreate.call(this)
// At this point modules have already been initialized
Bugsee.launch(this, '0000000-0000-0000-0000-00000000000')
},
attachBaseContext: function (base) {
superProto.attachBaseContext.call(this, base)
}
})
在 app/App_Resources/Android/src/AndroidManifest
中将以下内容
<application android:name="com.tns.NativeScriptApplication"
改为以下内容 - 以匹配上面的应用名称
<application android:name="org.yourApplicationName.Application"
许可证
Apache 许可证版本 2.0,2004 年 1 月