@revopush/react-native-code-push 1.5.0 → 1.5.1

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.
@@ -22,7 +22,7 @@
22
22
  }
23
23
 
24
24
  -keepclassmembers class com.facebook.react.runtime.ReactHostImpl {
25
- private final ** reactHostDelegate;
25
+ private final ** mReactHostDelegate;
26
26
  }
27
27
 
28
28
  -keep interface com.facebook.react.runtime.ReactHostDelegate { *; }
@@ -849,7 +849,14 @@ public class CodePushNativeModule extends BaseJavaModule {
849
849
  public ReactHostDelegate getReactHostDelegate(ReactHostImpl reactHostImpl) {
850
850
  try {
851
851
  Class<?> clazz = reactHostImpl.getClass();
852
- Field field = clazz.getDeclaredField("reactHostDelegate");
852
+ Field field;
853
+ try {
854
+ // RN < 0.81
855
+ field = clazz.getDeclaredField("mReactHostDelegate");
856
+ } catch (NoSuchFieldException e) {
857
+ // RN >= 0.81
858
+ field = clazz.getDeclaredField("reactHostDelegate");
859
+ }
853
860
  field.setAccessible(true);
854
861
 
855
862
  // Get the value of the field for the provided instance
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revopush/react-native-code-push",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
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",