From a413de9270ead46d943dcea8a8779e8472d66a73 Mon Sep 17 00:00:00 2001 From: Bruno Date: Sat, 2 Nov 2024 17:38:14 -0400 Subject: [PATCH] fix: retrieval of bridge (#490) --- ios/QuickCryptoModule.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ios/QuickCryptoModule.mm b/ios/QuickCryptoModule.mm index a3831b1e..c69e7a16 100644 --- a/ios/QuickCryptoModule.mm +++ b/ios/QuickCryptoModule.mm @@ -9,12 +9,17 @@ @implementation QuickCryptoModule +@synthesize bridge=_bridge; + RCT_EXPORT_MODULE(QuickCrypto) +- (void)setBridge:(RCTBridge *)bridge { + _bridge = bridge; +} + RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install) { NSLog(@"Installing JSI bindings for react-native-quick-crypto..."); - RCTBridge* bridge = [RCTBridge currentBridge]; - RCTCxxBridge* cxxBridge = (RCTCxxBridge*)bridge; + RCTCxxBridge* cxxBridge = (RCTCxxBridge*)_bridge; if (cxxBridge == nil) { return @false; } @@ -26,7 +31,7 @@ @implementation QuickCryptoModule return @false; } auto& runtime = *jsiRuntime; - auto callInvoker = bridge.jsCallInvoker; + auto callInvoker = _bridge.jsCallInvoker; auto workerQueue = std::make_shared("margelo crypto thread");