简体   繁体   English

在iOS Swift 3中实现Firebase崩溃报告的最佳方法是什么

[英]What is the best way to implement firebase crash report in iOS swift 3

Here incase of android firebase crash can be implemented in APPLICATION class like.. below example 这里柜面的Android火力坠毁在应用类中实现如.. 下面的例子

(...here, if android app is crashed this overrriden method uncaughtException(Thread thread, Throwable e) is called where we report crash to firebase...) (...在这里,如果android应用程序崩溃,则此重写方法 uncaughtException(Thread thread,Throwable e)会在我们向Firebase报告崩溃的地方调用...)

So, I want to know if there is any better way to implement firebase crash in iOS swift 3 like this. 所以,我想知道是否有更好的方法可以在iOS swift 3中实现Firebase崩溃

/** onCreate method of MainApplication.java */
@Override
public void onCreate() {
    super.onCreate();
    reportFirebaseCrash();
}

/** Report FirebaseCrash Exception if application crashed */
private void reportFirebaseCrash() {

        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
            @Override
            public void uncaughtException(Thread thread, Throwable e) {
                AppUtils.showLog(TAG, "reportFirebaseCrash");
                FirebaseCrash.report(e);
        }
    });

}

Highly recommend you check out the Firebase docs — they're quite well done and should give you all the help you need to get started. 强烈建议您查看Firebase文档 -它们做得很好,应该为您提供入门所需的所有帮助。

In particular, the simplest way to get up and running is to use the crash reporting pod: 特别是,最简单的启动和运行方式是使用崩溃报告窗格:

pod 'Firebase/Crash'

Then you need to configure a FIRApp shared instance. 然后,您需要配置FIRApp共享实例。 Once that's set up (or if you have already), you need to configure your build system to upload crash reports. 设置完成后(如果已经设置),则需要配置构建系统以上载崩溃报告。 The docs link includes all the necessary details to do it, but tl;dr, you need to create a new Run Script build phase: docs链接包含所有必要的详细信息,但是tl; dr,您需要创建一个新的Run Script构建阶段:

# Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
GOOGLE_APP_ID=1:my:app:id

# Replace the /Path/To/ServiceAccount.json with the path to the key you just downloaded
"${PODS_ROOT}"/FirebaseCrash/upload-sym "/Path/To/ServiceAccount.json"

Firebase also supports Bitcode in order to gather crash data from production users. Firebase还支持Bitcode ,以便从生产用户那里收集崩溃数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在iOS上将崩溃日志与控制台日志一起报告的最佳方法? - Best way to report crash logs alongside console logs on iOS? 在 iOS 中使用 Swift 做出决定的最佳方式是什么 - What is the best way to make decisions in iOS with Swift Firebase崩溃.. iOS Swift - Firebase Crash.. iOS Swift 在iOS中实现下拉UI的最佳方式(Swift) - Best way to implement drop down UI in iOS (Swift) Firebase iOS崩溃报告的可读性问题 - Firebase iOS crash report readability issues 崩溃报告未在Flurry中收到(Swift,iOS) - Crash Report not receiving in Flurry (Swift, iOS) 截至2012年,在iOS 4上实现自定义导航栏样式的最佳方法是什么 - As of 2012, what is the best way to implement a custom navigation bar style on iOS 4 在iOS中实现离线数据存储并同步到服务器的最佳方法是什么 - What is the best way to implement offline data storage and sync to server in iOS 从iOS应用程序在服务器上实现动态搜索的最佳方法是什么? - What is the best way to implement dynamic search on the server from iOS application? 在iOS中,实现滑动“抽屉”的最佳方法是什么 - In iOS, what's the best way to implement sliding “drawers”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM