diff --git a/packages/react-native-audio-api/android/CMakeLists.txt b/packages/react-native-audio-api/android/CMakeLists.txt index 8e1d514b..376e3b9e 100644 --- a/packages/react-native-audio-api/android/CMakeLists.txt +++ b/packages/react-native-audio-api/android/CMakeLists.txt @@ -52,10 +52,9 @@ find_package(fbjni REQUIRED CONFIG) find_package (oboe REQUIRED CONFIG) set(LINK_LIBRARIES + ReactAndroid::reactnative ReactAndroid::jsi - ReactAndroid::reactnativejni fbjni::fbjni - ReactAndroid::folly_runtime android log oboe::oboe diff --git a/packages/react-native-audio-api/ios/AudioAPIModule.mm b/packages/react-native-audio-api/ios/AudioAPIModule.mm index d5bb5f3e..7c2cc57a 100644 --- a/packages/react-native-audio-api/ios/AudioAPIModule.mm +++ b/packages/react-native-audio-api/ios/AudioAPIModule.mm @@ -14,19 +14,23 @@ @implementation AudioAPIModule RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install) { NSLog(@"Installing JSI bindings for react-native-audio-api..."); - RCTBridge *bridge = [RCTBridge currentBridge]; - RCTCxxBridge *cxxBridge = (RCTCxxBridge *)bridge; + RCTCxxBridge *cxxBridge = (RCTCxxBridge *)[RCTBridge currentBridge]; + if (cxxBridge == nil) { + NSLog(@"Error during getting bridge!"); return @false; } using namespace facebook; - auto jsiRuntime = (jsi::Runtime *)cxxBridge.runtime; - if (jsiRuntime == nil) { + auto jsRuntime = (jsi::Runtime *)cxxBridge.runtime; + + if (jsRuntime == nil) { + NSLog(@"Error during getting jsRuntime!"); return @false; } - auto &runtime = *jsiRuntime; + + auto &runtime = *jsRuntime; auto wrapper = std::make_shared(); auto hostObject = std::make_shared(wrapper);