disable Instabug for development env

This commit is contained in:
Roman Volosovskyi 2017-05-17 16:22:10 +03:00
parent f165492b33
commit 88cee34997
3 changed files with 66 additions and 57 deletions

View File

@ -1,74 +1,77 @@
package im.status.ethereum;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.pusherman.networkinfo.RNNetworkInfoPackage;
import me.alwx.HttpServer.HttpServerReactPackage;
import es.tiarg.nfcreactnative.NfcReactNativePackage;
import com.instabug.reactlibrary.RNInstabugReactnativePackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage;
import com.bitgo.randombytes.RandomBytesPackage;
import com.cboy.rn.splashscreen.SplashScreenReactPackage;
import com.centaurwarchief.smslistener.SmsListenerPackage;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage;
import com.github.yamill.orientation.OrientationPackage;
import com.i18n.reactnativei18n.ReactNativeI18n;
import com.instabug.reactlibrary.RNInstabugReactnativePackage;
import com.lwansbrough.RCTCamera.RCTCameraPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.pusherman.networkinfo.RNNetworkInfoPackage;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.rnfs.RNFSPackage;
import com.rt2zz.reactnativecontacts.ReactNativeContacts;
import es.tiarg.nfcreactnative.NfcReactNativePackage;
import fr.bamlab.rnimageresizer.ImageResizerPackage;
import im.status.ethereum.module.StatusPackage;
import io.realm.react.RealmReactPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.rt2zz.reactnativecontacts.ReactNativeContacts;
import com.i18n.reactnativei18n.ReactNativeI18n;
import com.bitgo.randombytes.RandomBytesPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.lwansbrough.RCTCamera.*;
import com.centaurwarchief.smslistener.SmsListenerPackage;
import com.github.yamill.orientation.OrientationPackage;
import com.rnfs.RNFSPackage;
import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage;
import fr.bamlab.rnimageresizer.ImageResizerPackage;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage;
import me.alwx.HttpServer.HttpServerReactPackage;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = Arrays.asList(
new MainReactPackage(),
new RNNetworkInfoPackage(),
new HttpServerReactPackage(),
new NfcReactNativePackage(),
new SplashScreenReactPackage(),
new StatusPackage(BuildConfig.DEBUG),
new RealmReactPackage(),
new VectorIconsPackage(),
new ReactNativeContacts(),
new ReactNativeI18n(),
new RandomBytesPackage(),
new LinearGradientPackage(),
new RCTCameraPackage(),
new SmsListenerPackage(),
new OrientationPackage(),
new RNFSPackage(),
new ReactNativeDialogsPackage(),
new ImageResizerPackage(),
new PickerPackage(),
new WebViewBridgePackage(BuildConfig.DEBUG)
);
if (!BuildConfig.DEBUG) {
packages.add(new RNInstabugReactnativePackage("b239f82a9cb00464e4c72cc703e6821e", MainApplication.this, "shake"));
}
return packages;
}
};
@Override
protected List<ReactPackage> getPackages() {
return Arrays.asList(
new MainReactPackage(),
new RNNetworkInfoPackage(),
new HttpServerReactPackage(),
new NfcReactNativePackage(),
new RNInstabugReactnativePackage("b239f82a9cb00464e4c72cc703e6821e",MainApplication.this,"shake"),
new SplashScreenReactPackage(),
new StatusPackage(BuildConfig.DEBUG),
new RealmReactPackage(),
new VectorIconsPackage(),
new ReactNativeContacts(),
new ReactNativeI18n(),
new RandomBytesPackage(),
new LinearGradientPackage(),
new RCTCameraPackage(),
new SmsListenerPackage(),
new OrientationPackage(),
new RNFSPackage(),
new ReactNativeDialogsPackage(),
new ImageResizerPackage(),
new PickerPackage(),
new WebViewBridgePackage(BuildConfig.DEBUG)
);
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}

View File

@ -34,7 +34,9 @@
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
#ifndef DEBUG
[Instabug startWithToken:@"5534212f4a44f477c9ab270ab5cd2062" invocationEvent:IBGInvocationEventShake];
#endif
[SplashScreen show];
return YES;
}

View File

@ -1,5 +1,9 @@
(ns status-im.utils.instabug)
(ns status-im.utils.instabug
(:require [taoensso.timbre :as log]))
(def instabug-rn (js/require "instabug-reactnative"))
(defn log [str] (.IBGLog instabug-rn str))
(defn log [str]
(if js/goog.DEBUG
(log/debug str)
(.IBGLog instabug-rn str)))