How to programmatically get Crashlytics version with Firebase on iOS

我与影子孤独终老i 提交于 2020-12-15 05:44:06

问题


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

Crashlytics.sharedInstance().version

With Firebase:

  • 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.

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

回答1:


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

Swift:

FirebaseCore.FirebaseVersion()

Objc

FIRFirebaseVersion()



回答2:


Chintan from Firebase here. This has just been implemented in the latest version of Crashlytics iOS SDK (7.0.1). So from now on Crashlytics will use the same version as iCore, so here’s the API for it: https://firebase.google.com/docs/reference/ios/firebasecore/api/reference/Functions



来源:https://stackoverflow.com/questions/64706652/how-to-programmatically-get-crashlytics-version-with-firebase-on-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!