如何在iOS上使用Firebase以编程方式获取Crashlytics版本 [英] How to programmatically get Crashlytics version with Firebase on iOS

查看:97
本文介绍了如何在iOS上使用Firebase以编程方式获取Crashlytics版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Fabric ,它是以下内容(在此处回答):

With Fabric, it was the following (answered here):

Crashlytics.sharedInstance().version

使用 Firebase :

  • 该实例为 Crashlytics.crashlytics(),但是上面没有版本
  • FIRCrashlytics.h
  • 由于 Crashlytics NSObject ,因此 Crashlytics.version 存在,但等于0.
  • 我还查看了 FirebaseCrashlytics 模块无济于事.
  • the instance is Crashlytics.crashlytics(), but there is no version on it
  • nothing of interest in FIRCrashlytics.h
  • Since Crashlytics is an NSObject, Crashlytics.version exists, but it's equal to 0.
  • I also looked on the FirebaseCrashlytics module to no avail.

AppDelegate 中运行 FabricApp.configure 时,实际上在控制台中打印了Crashlytics版本,因此它明确定义在某个地方,但是我需要访问它才能显示它在应用程序中:

The Crashlytics version is actually printed in the console when running FabricApp.configure in the AppDelegate, so it's clearly defined somewhere, but I need to access it to display it in the app:

${time_stamp} ${app_name}[${process_id}] [Firebase/Crashlytics] Version 4.3.1

推荐答案

API已添加到Firebase/Crashlytics 7.1.0:

The API was added to Firebase/Crashlytics 7.1.0: https://firebase.google.com/docs/reference/ios/firebasecore/api/reference/Functions#/c:@F@FIRFirebaseVersion

迅速:

FirebaseCore.FirebaseVersion()

Objc

FIRFirebaseVersion()

这篇关于如何在iOS上使用Firebase以编程方式获取Crashlytics版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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