diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java b/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java index 064c3b8b3fdb48..c9679fafb96d71 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java @@ -60,6 +60,17 @@ protected String getJSMainModuleName() { return "index.android"; } + /** + * Returns the launchOptions which will be passed to the {@link ReactInstanceManager} + * when the application is started. By default, this will return null and an empty + * object will be passed to your top level component as its initial props. + * If your React Native application requires props set outside of JS, override + * this method to return the Android.os.Bundle of your desired initial props. + */ + protected @Nullable Bundle getLaunchOptions() { + return null; + } + /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. @@ -128,7 +139,7 @@ protected void onCreate(Bundle savedInstanceState) { mReactInstanceManager = createReactInstanceManager(); ReactRootView mReactRootView = createRootView(); - mReactRootView.startReactApplication(mReactInstanceManager, getMainComponentName()); + mReactRootView.startReactApplication(mReactInstanceManager, getMainComponentName(), getLaunchOptions()); setContentView(mReactRootView); }