How to disable Crashlytics iOS library using a flag?

后端 未结 2 346
感情败类
感情败类 2021-01-18 15:58

I am using latest Crashlytics library for iOS. I am looking to disable crashlytics using a single flag. How can I do that?

PS: I am not using set API key method as p

2条回答
  •  一整个雨季
    2021-01-18 16:29

    Swift language also supports conditional compilation:

    #if FABRIC
    Fabric.with([Crashlytics.self])
    #endif
    

    Define FABRIC as Swift compiler flag in Build Settings -> Swift Compiler - Custom Flags -> Other Swift Flags:

提交回复
热议问题