corymsmith / react-native-fabric

A React Native library for Fabric, Crashlytics and Answers
MIT License
1.31k stars 236 forks source link

Disable Answers & Crashlytics on development [iOS] #162

Closed nstr closed 6 years ago

nstr commented 6 years ago

Hello. How can I disable Answers and Crashlytics on development in iOS?

rudyryk commented 6 years ago

Hello @njnest!

This is probably not react-native-fabric question, but rather Fabric / Crashlytics for iOS specific. I would just disabled it with pre-compilder directive in AppDelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSLog(@"didFinishLaunchingWithOptions: %@", launchOptions);

  #if DEBUG
  NSLog(@"didFinishLaunchingWithOptions: skip Fabric init in DEBUG build");
  #else
  [Fabric with:@[[Crashlytics class]]];
  #endif

  // ...
}
nstr commented 6 years ago

thanks, @rudyryk

I think this will help.