Problem with adding Firebase Crashlytics to iOS Share Extension

Viewed 487

I'm trying to add Firebase to collect analytics events and crashes to iOS Share Extension. Everything works perfect in main app but not in Share Extension. I managed to find this way of initialization:

override func viewDidLoad() {
    super.viewDidLoad()
    if FirebaseApp.app() == nil {
        FirebaseApp.configure()
    }
    // other code
}

Analytics.logEvent works perfectly, I can see events in firebase console, but crashes are not collected.

In addition, xcode organizer periodically collects the following crashes:

enter image description here

Who can tell what could be the reason and what to do to make Crashlytics collect crashes?

1 Answers

I managed to do it by adding this:

if FirebaseApp.app() == nil {
    FirebaseApp.configure()
    Fabric.with([Crashlytics.self])
}
Related