kiwi-bop / flutter_crashlytics

:package: Flutter plugin for Crashlytics integration
BSD 2-Clause "Simplified" License
194 stars 46 forks source link

Skipping initialization for hybrid projects #65

Closed xinthink closed 5 years ago

xinthink commented 5 years ago

I'm doing a hybrid project, mainly in native with embedded flutter views. The Fabric SDK is initialized in the native part, and several configuration params are applied. So I added a skipInitialization method, to skip the initialization in the flutter part, but still mark it as initialized (especially for the iOS platform), it means that the Fabric functionalities are ready to be used.

jaumard commented 5 years ago

Hi, You don't need to add a skipInitialization, you can still call initialize but be sure you have initialized Fabric with your own configuration first. The doc says * Only the first call to this method is honored. Subsequent calls are no-ops., and it's because Fabric is a singleton. So if you call plugin initialize method after you already setup it it will just pass the flag to true and does what your skipInitialization do.

xinthink commented 5 years ago

Yes, but in my opinions, it makes the code less intuitive relying to the internal implementation of the 3rd party lib