vn-verdnaturachat/android/app/src/main/java/chat/rocket/reactnative/MainApplication.java

104 lines
3.4 KiB
Java
Raw Normal View History

package chat.rocket.reactnative;
2017-08-03 18:23:43 +00:00
2019-03-12 16:23:06 +00:00
import android.app.Application;
import com.facebook.react.ReactApplication;
import org.wonday.orientation.OrientationPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
2017-08-03 18:23:43 +00:00
import com.AlexanderZaytsev.RNI18n.RNI18nPackage;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
2017-08-09 19:02:09 +00:00
import com.RNFetchBlob.RNFetchBlobPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.crashlytics.android.Crashlytics;
import com.dylanvann.fastimage.FastImageViewPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.rnim.rn.audio.ReactNativeAudioPackage;
import com.smixx.fabric.FabricPackage;
import com.wix.reactnativekeyboardinput.KeyboardInputPackage;
import com.wix.reactnativenotifications.RNNotificationsPackage;
import com.wix.reactnativenotifications.core.AppLaunchHelper;
import com.wix.reactnativenotifications.core.AppLifecycleFacade;
import com.wix.reactnativenotifications.core.JsIOHelper;
import com.wix.reactnativenotifications.core.notification.INotificationsApplication;
import com.wix.reactnativenotifications.core.notification.IPushNotification;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
2019-01-30 12:11:02 +00:00
import com.actionsheet.ActionSheetPackage;
import io.fabric.sdk.android.Fabric;
import io.realm.react.RealmReactPackage;
2019-03-12 16:23:06 +00:00
import com.swmansion.rnscreens.RNScreensPackage;
2019-03-12 16:23:06 +00:00
import android.content.Context;
import android.os.Bundle;
2019-03-12 16:23:06 +00:00
import java.util.Arrays;
import java.util.List;
2017-08-03 18:23:43 +00:00
2019-03-12 16:23:06 +00:00
public class MainApplication extends Application implements ReactApplication, INotificationsApplication {
2019-03-12 16:23:06 +00:00
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
2019-03-12 16:23:06 +00:00
@Override
2017-08-03 18:23:43 +00:00
protected List<ReactPackage> getPackages() {
2019-03-12 16:23:06 +00:00
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new OrientationPackage(),
new SplashScreenReactPackage(),
new RNGestureHandlerPackage(),
new RNScreensPackage(),
new ActionSheetPackage(),
new RNDeviceInfo(),
new PickerPackage(),
new VectorIconsPackage(),
new RNFetchBlobPackage(),
new RealmReactPackage(),
new ReactVideoPackage(),
new ReactNativeAudioPackage(),
new KeyboardInputPackage(MainApplication.this),
new RocketChatNativePackage(),
new FabricPackage(),
new FastImageViewPackage(),
new RNI18nPackage(),
new RNNotificationsPackage(MainApplication.this)
);
}
@Override
2019-03-12 16:23:06 +00:00
protected String getJSMainModuleName() {
return "index";
2017-08-03 18:23:43 +00:00
}
2019-03-12 16:23:06 +00:00
};
2017-08-03 18:23:43 +00:00
2019-03-12 16:23:06 +00:00
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
2019-03-12 16:23:06 +00:00
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
SoLoader.init(this, /* native exopackage */ false);
}
@Override
public IPushNotification getPushNotification(Context context, Bundle bundle, AppLifecycleFacade defaultFacade, AppLaunchHelper defaultAppLaunchHelper) {
return new CustomPushNotification(
context,
bundle,
defaultFacade,
defaultAppLaunchHelper,
new JsIOHelper()
);
}
2017-08-03 18:23:43 +00:00
}