mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Adding emulator, simulator UIExplorer example across docs
Summary:Current docs show an Appetize.io example for AlertIOS doc. This pull request adds that feature across all applicable iOS and Android docs. So if a doc has an example in UIExplorer, it shows up in the top right and clicking to Play should navigate to the relevant example. The changes here also touched NavigationExperimental to fix a typo that prevented iOS deep link from working. Code was also added to help support Android deep links but there's an outstanding issue (a race condition) around how Android deep links trigger getInitialURL in NavigationRootContainer that prevents this from fully working. For adding the docs, a few things were done outside this pull request: 1/ Release builds for UIExplorer Android and iOS apps were uploaded to Appetize.io. The Appetize.io info (public key to run the build) is embedded in the docs. 2/ The iOS build was generated by making a few changes to get a local bundle. The current UIExplorer set up doesn't support "react-native run-ios". Regarding the Appetize bu Closes https://github.com/facebook/react-native/pull/6306 Differential Revision: D3129651 Pulled By: bestander fb-gh-sync-id: d296d64db8236faa36f35484bb6b362990caf934 fbshipit-source-id: d296d64db8236faa36f35484bb6b362990caf934
This commit is contained in:
committed by
Facebook Github Bot 6
parent
67b138e77c
commit
09958618c5
@@ -23,7 +23,32 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
public class UIExplorerActivity extends ReactActivity {
|
||||
private final String PARAM_ROUTE = "route";
|
||||
private Bundle mInitialProps = null;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// Get remote param before calling super which uses it
|
||||
Bundle bundle = getIntent().getExtras();
|
||||
if (bundle != null && bundle.containsKey(PARAM_ROUTE)) {
|
||||
String routeUri = new StringBuilder("rnuiexplorer://example/")
|
||||
.append(bundle.getString(PARAM_ROUTE))
|
||||
.append("Example")
|
||||
.toString();
|
||||
mInitialProps = new Bundle();
|
||||
mInitialProps.putString("exampleFromAppetizeParams", routeUri);
|
||||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Bundle getLaunchOptions() {
|
||||
return mInitialProps;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getMainComponentName() {
|
||||
return "UIExplorerApp";
|
||||
|
||||
Reference in New Issue
Block a user