diff --git a/package/ios/AppleFilamentProxy.h b/package/ios/AppleFilamentProxy.h index 78a1364f..f8863982 100644 --- a/package/ios/AppleFilamentProxy.h +++ b/package/ios/AppleFilamentProxy.h @@ -7,8 +7,8 @@ // #include "FilamentProxy.h" -#include #include +#include namespace margelo { @@ -16,10 +16,10 @@ class AppleFilamentProxy : public FilamentProxy { public: explicit AppleFilamentProxy(jsi::Runtime* runtime, std::shared_ptr callInvoker); ~AppleFilamentProxy(); - + public: - int loadModel(const std::string &path) override; - + int loadModel(const std::string& path) override; + private: jsi::Runtime* _runtime; std::shared_ptr _callInvoker; diff --git a/package/ios/AppleFilamentProxy.mm b/package/ios/AppleFilamentProxy.mm index 1b77b417..e985fec3 100644 --- a/package/ios/AppleFilamentProxy.mm +++ b/package/ios/AppleFilamentProxy.mm @@ -5,21 +5,21 @@ // Created by Marc Rousavy on 20.02.24. // -#import #import "AppleFilamentProxy.h" +#import namespace margelo { - -AppleFilamentProxy::AppleFilamentProxy(jsi::Runtime* runtime, std::shared_ptr callInvoker): - _runtime(runtime), _callInvoker(callInvoker) { } - + +AppleFilamentProxy::AppleFilamentProxy(jsi::Runtime* runtime, std::shared_ptr callInvoker) + : _runtime(runtime), _callInvoker(callInvoker) {} + AppleFilamentProxy::~AppleFilamentProxy() { // TODO(hanno): cleanup here? } - -int AppleFilamentProxy::loadModel(const std::string &path) { + +int AppleFilamentProxy::loadModel(const std::string& path) { // TODO(hanno): Implement model loading here return 13; } - + } // namespace margelo diff --git a/package/ios/FilamentInstaller.mm b/package/ios/FilamentInstaller.mm index 1f479347..077dafba 100644 --- a/package/ios/FilamentInstaller.mm +++ b/package/ios/FilamentInstaller.mm @@ -5,9 +5,9 @@ // Created by Marc Rousavy on 20.02.24. // -#import #import "FilamentInstaller.h" #import "AppleFilamentProxy.h" +#import #import #import @@ -22,7 +22,7 @@ @interface RCTCxxBridge (CallInvoker) @implementation FilamentInstaller -+ (BOOL)installToBridge:(RCTBridge *)bridge { ++ (BOOL)installToBridge:(RCTBridge*)bridge { RCTCxxBridge* cxxBridge = (RCTCxxBridge*)[RCTBridge currentBridge]; if (!cxxBridge.runtime) { return NO; diff --git a/package/ios/FilamentViewManager.mm b/package/ios/FilamentViewManager.mm index c1b50fc0..b747c53c 100644 --- a/package/ios/FilamentViewManager.mm +++ b/package/ios/FilamentViewManager.mm @@ -1,8 +1,8 @@ +#import "FilamentInstaller.h" #import "RCTBridge.h" #import "Utils.h" #import #import -#import "FilamentInstaller.h" @interface FilamentViewManager : RCTViewManager @end diff --git a/package/src/FilamentProxy.ts b/package/src/FilamentProxy.ts index 71d1a804..00820843 100644 --- a/package/src/FilamentProxy.ts +++ b/package/src/FilamentProxy.ts @@ -16,7 +16,10 @@ if (global.nativeCallSyncHook == null) { ) } -// TODO: Figure out how to call the native install method. I couldn't get codegen to properly generate that static method. +// TODO(hanno): Figure out how to call the native install method. I couldn't get codegen to properly generate that static method. +// In Bridge architecture there was a separate Module and View, but now it's all a View - how do I add static methods on that? +// Maybe we need to create a separate FilamentModule as well (in addition to the FilamentView). +// @ts-expect-error const successful = FilamentViewNativeComponent.install() if (!successful) { throw new Error('Failed to initialize react-native-filament! Check the native logs (adb logcat or Xcode logs) for more information.')