简体   繁体   中英

Can we bootstrap Crashlytics on a background thread on iOS?

We are trying to reduce the cold start latency in our iOS application and we noticed that Crashlytics can take between 50 and 150ms (on low end devices) to do it's setup through their API:

Fabric.with([Crashlytics.self])

This is instructed to run as early as possible in the app lifecycle.

Has anyone found documentation or tried running this bit of code in a background queue with success?

Mike from Fabric here. If you init on the background thread, you run the risk of missing crashes on app launch, so technically you can, but there are tradeoffs that are made. In general, in my testing, I see an init of 30-60ms.

If you implement the CrashlyticsDelegate protocol (specifically the crashlyticsDidDetectReportForLastExecution callback) and set yourself as the delegate, then Crashlytics will upload the crash reports asynchronously, so you won't need to put the initialization to a background thread:

Just implementing this delegate method will disable all forms of synchronous report submission. This can impact the reliability of reporting crashes very early in application launch.

https://docs.fabric.io/appledocs/Crashlytics/Protocols/CrashlyticsDelegate.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM