react-native-background-downloader icon indicating copy to clipboard operation
react-native-background-downloader copied to clipboard

RCTJavaScriptDidLoadNotification never fires; iOS JS never receives event

Open alecgorge opened this issue 10 months ago • 1 comments

Today I used patch-package to patch @kesha-antonov/[email protected] for the project I'm working on.

Downloads were working fine on Android, and native logs all looked fine on iOS but it would never publish the events back to JS. I'm not sure if these is a safe fix but it has worked okay for me so far.

diff --git a/node_modules/@kesha-antonov/react-native-background-downloader/ios/RNBackgroundDownloader.m b/node_modules/@kesha-antonov/react-native-background-downloader/ios/RNBackgroundDownloader.m
index fb90c07..a96954a 100644
--- a/node_modules/@kesha-antonov/react-native-background-downloader/ios/RNBackgroundDownloader.m
+++ b/node_modules/@kesha-antonov/react-native-background-downloader/ios/RNBackgroundDownloader.m
@@ -152,6 +152,8 @@ RCT_EXPORT_MODULE();
                                                   selector:@selector(handleBridgeJavascriptLoad:)
                                                   name:RCTJavaScriptDidLoadNotification
                                                   object:nil];
+            
+            isJavascriptLoaded = YES;
         }
     }
 }

alecgorge avatar Nov 29 '24 21:11 alecgorge