Skip to content

Commit

Permalink
disable Instabug for development env
Browse files Browse the repository at this point in the history
  • Loading branch information
rasom committed May 17, 2017
1 parent f165492 commit 58fe57d
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 57 deletions.
111 changes: 57 additions & 54 deletions android/app/src/main/java/im/status/ethereum/MainApplication.java
Original file line number Diff line number Diff line change
@@ -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 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.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.aakashns.reactnativedialogs.ReactNativeDialogsPackage;
import com.rt2zz.reactnativecontacts.ReactNativeContacts;
import es.tiarg.nfcreactnative.NfcReactNativePackage;
import fr.bamlab.rnimageresizer.ImageResizerPackage;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage;
import im.status.ethereum.module.StatusPackage;
import io.realm.react.RealmReactPackage;
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;
}
}
2 changes: 2 additions & 0 deletions ios/StatusIm/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
#ifndef DEBUG
[Instabug startWithToken:@"5534212f4a44f477c9ab270ab5cd2062" invocationEvent:IBGInvocationEventShake];
#endif
[SplashScreen show];
return YES;
}
Expand Down
10 changes: 7 additions & 3 deletions src/status_im/utils/instabug.cljs
Original file line number Diff line number Diff line change
@@ -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"))
(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)))

0 comments on commit 58fe57d

Please sign in to comment.