Example usage for com.facebook.react ReactNativeHost ReactNativeHost

List of usage examples for com.facebook.react ReactNativeHost ReactNativeHost

Introduction

In this page you can find the example usage for com.facebook.react ReactNativeHost ReactNativeHost.

Prototype

protected ReactNativeHost(Application application) 

Source Link

Usage

From source file:com.cilstoredemo.CILReactActivity.java

License:Open Source License

/**
 * Called at construction time, override if you have a custom delegate implementation.
 *
 * ?bundleName/*w w  w.  j av  a 2 s  . c  om*/
 */
protected CILReactActivityDelegate createReactActivityDelegate() {
    CILReactActivityDelegate reactActivityDelegate = new CILReactActivityDelegate(this, getMainComponentName());
    reactActivityDelegate.setReactNativeHost(new ReactNativeHost(MainApplication.getApplication()) {
        @Override
        public boolean getUseDeveloperSupport() {
            // NOTE: bundleTrue??False
            return !BuildConfig.DEBUG;
        }

        @Override
        protected List<ReactPackage> getPackages() {
            return Arrays.<ReactPackage>asList(new MainReactPackage()
            // NOTE: Package
            );
        }

        @Override
        protected String getJSMainModuleName() {
            return bundleName;
        }

        @Nullable
        @Override
        protected String getBundleAssetName() {
            return bundleName + ".bundle";
        }
    });
    return reactActivityDelegate;
}