diff --git a/native/android/app/src/cpp/jsiInstaller.cpp b/native/android/app/src/cpp/jsiInstaller.cpp --- a/native/android/app/src/cpp/jsiInstaller.cpp +++ b/native/android/app/src/cpp/jsiInstaller.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -25,14 +26,20 @@ comm::HashMap additionalParameters) { jsi::Runtime *rt = (jsi::Runtime *)jsContext; auto jsCallInvoker = jsCallInvokerHolder->cthis()->getCallInvoker(); - std::shared_ptr nativeModule = + std::shared_ptr coreNativeModule = std::make_shared(jsCallInvoker); + std::shared_ptr utilsNativeModule = + std::make_shared(jsCallInvoker); if (rt != nullptr) { rt->global().setProperty( *rt, jsi::PropNameID::forAscii(*rt, "CommCoreModule"), - jsi::Object::createFromHostObject(*rt, nativeModule)); + jsi::Object::createFromHostObject(*rt, coreNativeModule)); + rt->global().setProperty( + *rt, + jsi::PropNameID::forAscii(*rt, "CommUtilsModule"), + jsi::Object::createFromHostObject(*rt, utilsNativeModule)); } jni::local_ref sqliteFilePathObj = diff --git a/native/ios/Comm/AppDelegate.mm b/native/ios/Comm/AppDelegate.mm --- a/native/ios/Comm/AppDelegate.mm +++ b/native/ios/Comm/AppDelegate.mm @@ -39,6 +39,7 @@ #import #import "CommCoreModule.h" +#import "CommUtilsModule.h" #import "GlobalDBSingleton.h" #import "Logger.h" #import "MessageOperationsUtilities.h" @@ -257,13 +258,19 @@ } __typeof(self) strongSelf = weakSelf; if (strongSelf) { - std::shared_ptr nativeModule = + std::shared_ptr coreNativeModule = std::make_shared(bridge.jsCallInvoker); + std::shared_ptr utilsNativeModule = + std::make_shared(bridge.jsCallInvoker); rt.global().setProperty( rt, facebook::jsi::PropNameID::forAscii(rt, "CommCoreModule"), - facebook::jsi::Object::createFromHostObject(rt, nativeModule)); + facebook::jsi::Object::createFromHostObject(rt, coreNativeModule)); + rt.global().setProperty( + rt, + facebook::jsi::PropNameID::forAscii(rt, "CommUtilsModule"), + facebook::jsi::Object::createFromHostObject(rt, utilsNativeModule)); } }; const auto installer = diff --git a/native/native-modules.js b/native/native-modules.js --- a/native/native-modules.js +++ b/native/native-modules.js @@ -1,5 +1,7 @@ // @flow -import type { Spec } from './schema/CommCoreModuleSchema.js'; +import type { Spec as CoreModuleSpec } from './schema/CommCoreModuleSchema.js'; +import type { UtilsModuleSpec } from './schema/CommUtilsModuleSchema.js'; -export const commCoreModule: Spec = global.CommCoreModule; +export const commCoreModule: CoreModuleSpec = global.CommCoreModule; +export const commUtilsModule: UtilsModuleSpec = global.CommUtilsModule;