Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ We try our best to maintain backwards compatibility of our plugin with previous
| React Native version(s) | Supporting CodePush version(s) |
|-------------------------|---------------------------------------------------------------------------------------------|
| <v0.76 | Use [microsoft/code-push-react-native](https://github.com/microsoft/react-native-code-push) |
| v0.76, v0.77, 0.78 | v1.0+ *(Support both New and Old Architectures)* |
| 0.76, 0.77, 0.78, 0.79 | v1.0+ *(Support both New and Old Architectures)* |
| v0.80 | v1.2 |
| Expo sdk 52 | v1.3 |


We work hard to respond to new RN releases, but they do occasionally break us. We will update this chart with each RN release, so that users can check to see what our "official" support is.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ private void setJSBundle(ReactHostDelegate reactHostDelegate, String latestJSBun
Field bundleLoaderField = reactHostDelegate.getClass().getDeclaredField("jsBundleLoader");
bundleLoaderField.setAccessible(true);
bundleLoaderField.set(reactHostDelegate, latestJSBundleLoader);
} catch (Exception e) {
}
catch (NoSuchFieldException noSuchFileFound) {
// Ignore this error for Expo
}
catch (Exception e) {
CodePushUtils.log("Unable to set JSBundle of ReactHostDelegate - CodePush may not support this version of React Native");
throw new IllegalAccessException("Could not setJSBundle");
}
Expand Down Expand Up @@ -182,13 +186,23 @@ private void loadBundle() {
// logic to reload the current React context.
final ReactHost reactHost = resolveReactHost();
if (reactHost == null) {
loadBundleLegacy();
return;
}

String latestJSBundleFile = mCodePush.getJSBundleFileInternal(mCodePush.getAssetsBundleFileName());

// #2) Update the locally stored JS bundle file path
setJSBundle(getReactHostDelegate((ReactHostImpl) reactHost), latestJSBundleFile);
try {
if (reactHost instanceof ReactHostImpl) {
ReactHostDelegate delegate = getReactHostDelegate((ReactHostImpl) reactHost);
if (delegate != null) {
// #2) Update the locally stored JS bundle file path
setJSBundle(delegate, latestJSBundleFile);
}
}
} catch (Exception e) {
CodePushUtils.log("Exception setJSBundle: " + e.getMessage());
}

// #3) Get the context creation method
try {
Expand Down