@appzung/react-native-code-push 11.0.1 → 11.0.2

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
@@ -111,8 +111,8 @@ We try our best to maintain backwards compatibility of our plugin with previous
111
111
  | v0.65-v0.70 | 4.1+ (TLS 1.2+) | 9 | ✅ | ❌ | v7.1.1 |
112
112
  | v0.71-v0.79 | 4.1+ (TLS 1.2+) | 9 | ✅ | ❌ | v8.3.2 |
113
113
  | v0.71-v0.79 | 4.1+ (TLS 1.2+) | 15.5 | ✅ | ❌ | v9.0.2 |
114
- | v0.71+ | 4.1+ (TLS 1.2+) | 15.5 | ✅ | ❌ | v10+ |
115
- | v0.74+ | 4.1+ (TLS 1.2+) | 15.5 | ✅ | ✅ | v11+ |
114
+ | v0.71-v0.80 | 4.1+ (TLS 1.2+) | 15.5 | ✅ | ❌ | v10+ |
115
+ | v0.74-v0.81 | 4.1+ (TLS 1.2+) | 15.5 | ✅ | ✅ | v11+ |
116
116
 
117
117
  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.
118
118
 
@@ -22,6 +22,7 @@
22
22
  }
23
23
  -keepclassmembers class com.facebook.react.runtime.ReactHostImpl {
24
24
  private final ** mReactHostDelegate;
25
+ private final ** reactHostDelegate;
25
26
  }
26
27
  -keep interface com.facebook.react.runtime.ReactHostDelegate { *; }
27
28
  -keep class * implements com.facebook.react.runtime.ReactHostDelegate { *; }
@@ -268,11 +268,6 @@ public class CodePushNativeModule extends BaseJavaModule {
268
268
  @Override
269
269
  public void run() {
270
270
  try {
271
- // We don't need to resetReactRootViews anymore
272
- // due the issue https://github.com/facebook/react-native/issues/14533
273
- // has been fixed in RN 0.46.0
274
- //resetReactRootViews(instanceManager);
275
-
276
271
  instanceManager.recreateReactContextInBackground();
277
272
  mCodePush.initializeUpdateAfterRestart();
278
273
  } catch (Exception e) {
@@ -312,20 +307,6 @@ public class CodePushNativeModule extends BaseJavaModule {
312
307
  return false;
313
308
  }
314
309
 
315
- // This workaround has been implemented in order to fix https://github.com/facebook/react-native/issues/14533
316
- // resetReactRootViews allows to call recreateReactContextInBackground without any exceptions
317
- // This fix also relates to https://github.com/microsoft/react-native-code-push/issues/878
318
- private void resetReactRootViews(ReactInstanceManager instanceManager) throws NoSuchFieldException, IllegalAccessException {
319
- Field mAttachedRootViewsField = instanceManager.getClass().getDeclaredField("mAttachedRootViews");
320
- mAttachedRootViewsField.setAccessible(true);
321
- List<ReactRootView> mAttachedRootViews = (List<ReactRootView>) mAttachedRootViewsField.get(instanceManager);
322
- for (ReactRootView reactRootView : mAttachedRootViews) {
323
- reactRootView.removeAllViews();
324
- reactRootView.setId(View.NO_ID);
325
- }
326
- mAttachedRootViewsField.set(instanceManager, mAttachedRootViews);
327
- }
328
-
329
310
  private void clearLifecycleEventListener() {
330
311
  // Remove LifecycleEventListener to prevent infinite restart loop
331
312
  if (mLifecycleEventListener != null) {
@@ -915,7 +896,14 @@ public class CodePushNativeModule extends BaseJavaModule {
915
896
  public ReactHostDelegate getReactHostDelegate(ReactHostImpl reactHostImpl) {
916
897
  try {
917
898
  Class<?> clazz = reactHostImpl.getClass();
918
- Field field = clazz.getDeclaredField("mReactHostDelegate");
899
+ Field field;
900
+ try {
901
+ // RN < 0.81
902
+ field = clazz.getDeclaredField("mReactHostDelegate");
903
+ } catch (NoSuchFieldException e) {
904
+ // RN >= 0.81
905
+ field = clazz.getDeclaredField("reactHostDelegate");
906
+ }
919
907
  field.setAccessible(true);
920
908
 
921
909
  // Get the value of the field for the provided instance
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- const version = exports.version = '11.0.1';
8
+ const version = exports.version = '11.0.2';
9
9
  //# sourceMappingURL=version.js.map
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  // Generated by genversion.
4
- export const version = '11.0.1';
4
+ export const version = '11.0.2';
5
5
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export declare const version = "11.0.1";
1
+ export declare const version = "11.0.2";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare const version = "11.0.1";
1
+ export declare const version = "11.0.2";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appzung/react-native-code-push",
3
- "version": "11.0.1",
3
+ "version": "11.0.2",
4
4
  "description": "React Native plugin for the CodePush service",
5
5
  "author": "Louis Lagrange <lagrange.louis@gmail.com> (https://github.com/Minishlink)",
6
6
  "license": "MIT",
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '11.0.1';
2
+ export const version = '11.0.2';