在Cordova android应用程序中使用Crittercism

xyz*_*xyz 2 cordova crittercism cordova-plugins

我们试图在我们的Cordova android应用程序中包含Crittercism.

我们在路径https://github.com/crittercism/PhoneGapExampleApp中使用该应用程序.但我们只看到实时统计中安装的应用程序数量而不是崩溃报告.即使应用程序崩溃,我们也无法在控制台中获取日志.请帮助我们在Cordova应用程序中包含Crittercism并获取崩溃报告.

注意:我们在应用程序崩溃时收到警报.但是我们想要使用免费版的Crittercism,因为我们只需要崩溃日志.

我们可以使用Crittercism来解决由于JavaScript内存问题引起的JavaScript崩溃或崩溃吗?

小智 6

我目前正在与Apteligent(以前称为Crittercism)合作,因此我可以提供一些有关您在Cordova应用程序中看到的内容的见解.

未处理的JavaScript错误往往以Handled Exceptions的形式出现,因为应用程序本身通常不会崩溃,而当时这种错误在Basic/Standard上不可用.处理的异常,现在都可以在标准层,所以如果你还在使用我们的标准,你应该能够看到他们在左侧处理的异常.

如果要将JavaScript错误报告为崩溃而不是Handled Exception,则可以使用setLogUnhandledExceptionAsCrash API:

Crittercism.setLogUnhandledExceptionAsCrash(value);
Crittercism.getLogUnhandledExceptionAsCrash();
Run Code Online (Sandbox Code Playgroud)

该值应为布尔值.有关如何使用setLogUnhandledExceptionAsCrash的示例:

function callCriticalBusinessFunction() {
    try {
        setLogUnhandledExceptionAsCrash(true);
        criticalBusinessFunction();
    } finally {
        setLogUnhandledExceptionAsCrash(false);
    }
}
Run Code Online (Sandbox Code Playgroud)