File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/main/java/com/appzung/codepush/react Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 2222}
2323-keepclassmembers class com.facebook.react.runtime.ReactHostImpl {
2424 private final ** mReactHostDelegate;
25+ private final ** reactHostDelegate;
2526}
2627-keep interface com.facebook.react.runtime.ReactHostDelegate { *; }
2728-keep class * implements com.facebook.react.runtime.ReactHostDelegate { *; }
Original file line number Diff line number Diff line change @@ -896,7 +896,14 @@ public void removeListeners(Integer count) {
896896 public ReactHostDelegate getReactHostDelegate (ReactHostImpl reactHostImpl ) {
897897 try {
898898 Class <?> clazz = reactHostImpl .getClass ();
899- 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+ }
900907 field .setAccessible (true );
901908
902909 // Get the value of the field for the provided instance
You can’t perform that action at this time.
0 commit comments