离子应用程序|Firebase Crashlytics无法与崩溃报告一起使用吗? [英] Ionic App | Firebase Crashlytics does not work with Crash Reporting?

查看:73
本文介绍了离子应用程序|Firebase Crashlytics无法与崩溃报告一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ionic App中使用@ ionic-native/firebase插件,该插件中包含崩溃报告.由于从9月9日起将无法再访问Firebase Crash Reporting,因此我们尝试切换到Firebase Crashlytics.但是我们在Crashlytics仪表板上没有任何崩溃数据.这是我尝试过的:

  • 首先,我遵循了

    一旦设置好东西,您只需要做

     从'capacitor-crashlytics'导入{Crashlytics};const crashlytics = new Crashlytics();////登录用户速成.logUser({名称:"John Doe",电子邮件:"john@doe.com",id:"123"}).then(()=> alert(`用户已登录`)).catch(err => alert(err.message));////强制当机crashlytics.crash(); 

    查看此内容以了解更多信息

    https://github.com/stewwan/capacitor-crashlytics

    旁注:我是创作者,随时可以发表PR或文件问题.

    I'm using @ionic-native/firebase plugin in our Ionic App, and crash reporting is included in this plugin. Since Firebase Crash Reporting will no longer be accessible after September 9, we are trying to switch to Firebase Crashlytics. But we're not getting any crash data on Crashlytics dashboard. Here's what I've tried:

    • First, I followed Get started with Firebase Crashlytics, built and ran our App. Then I found I could access Crashlytics dashboard, which I thought the SDK was implemented successfully. But after I crashed the app for a few times and waited for at least one day, but nothing showed up on either Crash Reporting or Crashlytics dashboard.

    • Then, I reversed the changes made to our app and built & ran again, firebase console didn't change back. I found this plugin cordova-plugin-firebase-crash and installed it to my app successfully. After crashing the app, almost immediately I got the crash data on Crash Reporting dashboard but no crashes on Crashlytics dashboard, but I could see the change on Crash-free statistics graph, which is weird. Now the Crashlytics dashboard looks like this:Crashlytics dashboard .

    My question is: does crashlytics not work when crash reporting is used in the App? Or did I implement crashlytics wrong? Any help would be appreciated.

    解决方案

    For those who are stuck with cordova , try get capacitor (which also supports cordova out-of-box)

    There’s a plugin for crashlytics

    once you got the stuff set up you'll only have to

    import { Crashlytics } from 'capacitor-crashlytics';
    const crashlytics = new Crashlytics();
    
    //
    // log user
    crashlytics
      .logUser({
        name: "John Doe",
        email: "john@doe.com",
        id: "123"
      })
      .then(() => alert(`user logged`))
      .catch(err => alert(err.message));
    
    //
    // force a crash
    crashlytics.crash();
    

    Check this out to learn more

    https://github.com/stewwan/capacitor-crashlytics

    side note: I’m the creator, feel free to PR or file issues.

    这篇关于离子应用程序|Firebase Crashlytics无法与崩溃报告一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆