Allow installing JS binding via the RN Android bridge

Reviewed By: fkgozali

Differential Revision: D6979072

fbshipit-source-id: 8b4ac3769496a6a6fe3dd9ee2aac64b66604c413
This commit is contained in:
David Vacca
2018-02-14 11:26:39 -08:00
committed by Facebook Github Bot
parent ecc08adf49
commit db391a500c
5 changed files with 74 additions and 26 deletions

View File

@@ -16,6 +16,7 @@ import java.util.List;
import android.app.Application;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.bridge.BridgeListener;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.bridge.ReactMarker;
import com.facebook.react.bridge.ReactMarkerConstants;
@@ -76,6 +77,7 @@ public abstract class ReactNativeHost {
.setRedBoxHandler(getRedBoxHandler())
.setJavaScriptExecutorFactory(getJavaScriptExecutorFactory())
.setUIImplementationProvider(getUIImplementationProvider())
.setBridgeListener(getBridgeListener())
.setInitialLifecycleState(LifecycleState.BEFORE_CREATE);
for (ReactPackage reactPackage : getPackages()) {
@@ -122,6 +124,10 @@ public abstract class ReactNativeHost {
return new UIImplementationProvider();
}
protected @Nullable BridgeListener getBridgeListener() {
return null;
}
/**
* Returns the name of the main module. Determines the URL used to fetch the JS bundle
* from the packager server. It is only used when dev support is enabled.