2017-11-06 23:45:48 +00:00
|
|
|
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;
|
2019-07-18 17:25:18 +00:00
|
|
|
import io.github.elyx0.reactnativedocumentpicker.DocumentPickerPackage;
|
2019-05-28 13:03:08 +00:00
|
|
|
import io.invertase.firebase.RNFirebasePackage;
|
|
|
|
import io.invertase.firebase.fabric.crashlytics.RNFirebaseCrashlyticsPackage;
|
|
|
|
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
|
|
|
|
import io.invertase.firebase.perf.RNFirebasePerformancePackage;
|
2019-05-18 19:31:33 +00:00
|
|
|
import com.reactnativecommunity.webview.RNCWebViewPackage;
|
2019-03-12 16:23:06 +00:00
|
|
|
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
|
|
|
|
2019-07-16 14:30:29 +00:00
|
|
|
import com.reactcommunity.rnlocalize.RNLocalizePackage;
|
2018-07-17 19:10:27 +00:00
|
|
|
import com.reactnative.ivpusic.imagepicker.PickerPackage;
|
2018-07-10 13:40:32 +00:00
|
|
|
import com.brentvatne.react.ReactVideoPackage;
|
|
|
|
import com.dylanvann.fastimage.FastImageViewPackage;
|
|
|
|
import com.oblador.vectoricons.VectorIconsPackage;
|
2018-03-07 00:17:20 +00:00
|
|
|
import com.rnim.rn.audio.ReactNativeAudioPackage;
|
2018-07-10 13:40:32 +00:00
|
|
|
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;
|
2018-09-19 14:18:32 +00:00
|
|
|
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
|
|
|
|
import com.learnium.RNDeviceInfo.RNDeviceInfo;
|
2019-01-30 12:11:02 +00:00
|
|
|
import com.actionsheet.ActionSheetPackage;
|
2018-07-10 13:40:32 +00:00
|
|
|
import io.realm.react.RealmReactPackage;
|
2019-03-12 16:23:06 +00:00
|
|
|
import com.swmansion.rnscreens.RNScreensPackage;
|
2019-07-18 17:44:02 +00:00
|
|
|
import chat.rocket.SharePackage;
|
|
|
|
import com.RNFetchBlob.RNFetchBlobPackage;
|
2018-07-10 13:40:32 +00:00
|
|
|
|
2019-06-21 16:39:20 +00:00
|
|
|
import chat.rocket.reactnative.generated.BasePackageList;
|
|
|
|
|
|
|
|
import org.unimodules.adapters.react.ModuleRegistryAdapter;
|
|
|
|
import org.unimodules.adapters.react.ReactModuleRegistryProvider;
|
|
|
|
import org.unimodules.core.interfaces.SingletonModule;
|
|
|
|
|
2019-03-12 16:23:06 +00:00
|
|
|
import android.content.Context;
|
|
|
|
import android.os.Bundle;
|
2017-09-21 17:08:00 +00:00
|
|
|
|
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 {
|
2018-10-23 21:39:48 +00:00
|
|
|
|
2019-06-21 16:39:20 +00:00
|
|
|
private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(new BasePackageList().getPackageList(), Arrays.<SingletonModule>asList());
|
|
|
|
|
2019-03-12 16:23:06 +00:00
|
|
|
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
|
|
|
|
@Override
|
|
|
|
public boolean getUseDeveloperSupport() {
|
|
|
|
return BuildConfig.DEBUG;
|
2018-07-10 13:40:32 +00:00
|
|
|
}
|
|
|
|
|
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(),
|
2019-07-18 17:25:18 +00:00
|
|
|
new DocumentPickerPackage(),
|
2019-05-28 13:03:08 +00:00
|
|
|
new RNFirebasePackage(),
|
|
|
|
new RNFirebaseCrashlyticsPackage(),
|
|
|
|
new RNFirebaseAnalyticsPackage(),
|
|
|
|
new RNFirebasePerformancePackage(),
|
2019-05-18 19:31:33 +00:00
|
|
|
new RNCWebViewPackage(),
|
2019-03-12 16:23:06 +00:00
|
|
|
new OrientationPackage(),
|
|
|
|
new SplashScreenReactPackage(),
|
2019-07-18 17:44:02 +00:00
|
|
|
new SharePackage(),
|
|
|
|
new RNFetchBlobPackage(),
|
2019-03-12 16:23:06 +00:00
|
|
|
new RNGestureHandlerPackage(),
|
|
|
|
new RNScreensPackage(),
|
|
|
|
new ActionSheetPackage(),
|
|
|
|
new RNDeviceInfo(),
|
|
|
|
new PickerPackage(),
|
|
|
|
new VectorIconsPackage(),
|
|
|
|
new RealmReactPackage(),
|
|
|
|
new ReactVideoPackage(),
|
|
|
|
new ReactNativeAudioPackage(),
|
|
|
|
new KeyboardInputPackage(MainApplication.this),
|
|
|
|
new FastImageViewPackage(),
|
2019-07-16 14:30:29 +00:00
|
|
|
new RNLocalizePackage(),
|
2019-06-21 16:39:20 +00:00
|
|
|
new RNNotificationsPackage(MainApplication.this),
|
|
|
|
new ModuleRegistryAdapter(mModuleRegistryProvider)
|
2019-03-12 16:23:06 +00:00
|
|
|
);
|
2018-07-10 13:40:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@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;
|
|
|
|
}
|
2018-07-10 13:40:32 +00:00
|
|
|
|
2019-03-12 16:23:06 +00:00
|
|
|
@Override
|
|
|
|
public void onCreate() {
|
|
|
|
super.onCreate();
|
|
|
|
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
|
|
|
}
|