[RN] Add workaround for loading different URLs on Android

Changing the props from native (Java) code was only added in 0.45, so add a
workaround until we get to updating our React Native dependency.
pull/1633/merge
Saúl Ibarra Corretgé 8 years ago committed by Lyubo Marinov
parent a075f24000
commit 84463d8cf0
  1. 18
      android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java

@ -142,15 +142,17 @@ public class JitsiMeetView extends FrameLayout {
props.putString("url", url.toString());
}
if (mReactRootView == null) {
mReactRootView = new ReactRootView(getContext());
mReactRootView.startReactApplication(mReactInstanceManager, "App", props);
mReactRootView.setBackgroundColor(BACKGROUND_COLOR);
addView(mReactRootView);
} else {
// TODO: ReactRootView#setAppProperties is only available on React Native 0.45.
throw new RuntimeException("Not yet supported");
// TODO: ReactRootView#setAppProperties is only available on React Native 0.45, so destroy
// the current root view and create a new one.
if (mReactRootView != null) {
removeView(mReactRootView);
mReactRootView = null;
}
mReactRootView = new ReactRootView(getContext());
mReactRootView.startReactApplication(mReactInstanceManager, "App", props);
mReactRootView.setBackgroundColor(BACKGROUND_COLOR);
addView(mReactRootView);
}
/**

Loading…
Cancel
Save