@revopush/react-native-code-push 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -50,7 +50,9 @@ We try our best to maintain backwards compatibility of our plugin with previous
50
50
  | React Native version(s) | Supporting CodePush version(s) |
51
51
  |-------------------------|---------------------------------------------------------------------------------------------|
52
52
  | <v0.76 | Use [microsoft/code-push-react-native](https://github.com/microsoft/react-native-code-push) |
53
- | v0.76, v0.77, 0.78 | v1.0+ *(Support both New and Old Architectures)* |
53
+ | 0.76, 0.77, 0.78, 0.79 | v1.0+ *(Support both New and Old Architectures)* |
54
+ | v0.80 | v1.2 |
55
+ | Expo sdk 52 | v1.3 |
54
56
 
55
57
 
56
58
  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.
@@ -152,7 +152,11 @@ public class CodePushNativeModule extends BaseJavaModule {
152
152
  Field bundleLoaderField = reactHostDelegate.getClass().getDeclaredField("jsBundleLoader");
153
153
  bundleLoaderField.setAccessible(true);
154
154
  bundleLoaderField.set(reactHostDelegate, latestJSBundleLoader);
155
- } catch (Exception e) {
155
+ }
156
+ catch (NoSuchFieldException noSuchFileFound) {
157
+ // Ignore this error for Expo
158
+ }
159
+ catch (Exception e) {
156
160
  CodePushUtils.log("Unable to set JSBundle of ReactHostDelegate - CodePush may not support this version of React Native");
157
161
  throw new IllegalAccessException("Could not setJSBundle");
158
162
  }
@@ -182,13 +186,23 @@ public class CodePushNativeModule extends BaseJavaModule {
182
186
  // logic to reload the current React context.
183
187
  final ReactHost reactHost = resolveReactHost();
184
188
  if (reactHost == null) {
189
+ loadBundleLegacy();
185
190
  return;
186
191
  }
187
192
 
188
193
  String latestJSBundleFile = mCodePush.getJSBundleFileInternal(mCodePush.getAssetsBundleFileName());
189
194
 
190
- // #2) Update the locally stored JS bundle file path
191
- setJSBundle(getReactHostDelegate((ReactHostImpl) reactHost), latestJSBundleFile);
195
+ try {
196
+ if (reactHost instanceof ReactHostImpl) {
197
+ ReactHostDelegate delegate = getReactHostDelegate((ReactHostImpl) reactHost);
198
+ if (delegate != null) {
199
+ // #2) Update the locally stored JS bundle file path
200
+ setJSBundle(delegate, latestJSBundleFile);
201
+ }
202
+ }
203
+ } catch (Exception e) {
204
+ CodePushUtils.log("Exception setJSBundle: " + e.getMessage());
205
+ }
192
206
 
193
207
  // #3) Get the context creation method
194
208
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revopush/react-native-code-push",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "React Native plugin for the CodePush service",
5
5
  "main": "CodePush.js",
6
6
  "typings": "typings/react-native-code-push.d.ts",