【问题标题】:Using Crittercism in Cordova android application在 Cordova android 应用程序中使用 Crittercism
【发布时间】:2016-03-18 04:25:04
【问题描述】:

我们正在尝试在我们的 Cordova android 应用程序中包含 Crittercism。

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

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

我们能否将 Crittercism 用于 JavaScript 崩溃或由于 JavaScript 内存问题而导致的崩溃?

【问题讨论】:

    标签: cordova cordova-plugins crittercism


    【解决方案1】:

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

    未处理的 JavaScript 错误往往以已处理异常的形式出现,因为应用程序本身通常不会崩溃,而这在当时 Basic/Standard 上是不可用的。已处理的异常现在在标准层中可用,因此如果您仍在使用我们的标准层,您应该能够在左侧的已处理异常下看到它们。

    如果您想将 JavaScript 错误报告为崩溃而不是处理异常,您可以使用 setLogUnhandledExceptionAsCrash API:

    Crittercism.setLogUnhandledExceptionAsCrash(value);
    Crittercism.getLogUnhandledExceptionAsCrash();
    

    该值应该是一个布尔值。 setLogUnhandledExceptionAsCrash 的使用示例:

    function callCriticalBusinessFunction() {
        try {
            setLogUnhandledExceptionAsCrash(true);
            criticalBusinessFunction();
        } finally {
            setLogUnhandledExceptionAsCrash(false);
        }
    }
    
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多