Reputation: 1905
Is there any way to disable crash reporting for Ad-Hoc builds? I only want crash reporting for release builds.
I know I can use following code but it only work debug builds.
#if DEBUG == 0
[Fabric with:@[CrashlyticsKit]];
#endif
Im using Fabric 1.1.3
Edit: I don't want to disable Fabric at all, I just need automatic configurations for Ad-Hoc and Release builds.
Upvotes: 12
Views: 9332
Reputation: 836
To disable firebase crashlytics for debug mode in swift:
#if DEBUG
Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(false)
#endif
Upvotes: 10
Reputation: 684
For Swift, Add this key to plist and set it 'NO'.
firebase_crashlytics_collection_enabled
After this, based on user-defined variable in Build Settings, you can configure this.
#if Development
print("Debug 1")
Fabric.sharedSDK().debug = true
#else
print("Debug 0")
Fabric.with([Crashlytics.self])
#endif
Upvotes: 2
Reputation: 32499
If you use Swift, this woud work:
#if !DEBUG
Fabric.with([Crashlytics.self])
#endif
Upvotes: 5
Reputation: 69489
Development builds are also DEBUG
builds, You are probably meaning Ad-Hoc builds.
Since the release and Ad-Hoc build use the same configuration you will not be able to tell them apart.
You bets option is to create a new configuration for the AppStore. For this configuration add a Preprocessor Macro
, Like FABRIC=1
Then in you build code:
#ifdef FABRIC
[Fabric with:@[CrashlyticsKit]];
#endif
Upvotes: 4
Reputation: 63
I think you can try this :
#ifndef DEBUG
[Fabric with:@[CrashlyticsKit]];
#endif
Upvotes: 5