[英]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.