@@ -25,12 +25,13 @@ @implementation SandboxReactNativeView
2525
2626- (instancetype )initWithFrame : (CGRect)frame {
2727 if (self = [super initWithFrame: frame]) {
28- _moduleName = @" sandbox" ;
29- _jsBundleName = @" index" ;
28+ _moduleName = @" App" ;
29+ _jsBundleSource = @" sandbox" ;
30+ _allowedTurboModules = @[@" NativeMicrotasksCxx" ];
3031 _initialProperties = @{};
3132 _launchOptions = @{};
32- _onError = nil ;
3333 _onMessage = nil ;
34+ _onError = nil ;
3435 }
3536 return self;
3637}
@@ -42,9 +43,9 @@ - (void)setModuleName:(NSString *)moduleName {
4243 }
4344}
4445
45- - (void )setJsBundleName : (NSString *)jsBundleName {
46- if (![_jsBundleName isEqualToString: jsBundleName ]) {
47- _jsBundleName = [jsBundleName copy ];
46+ - (void )setJsBundleSource : (NSString *)jsBundleSource {
47+ if (![_jsBundleSource isEqualToString: jsBundleSource ]) {
48+ _jsBundleSource = [jsBundleSource copy ];
4849 [self scheduleReactViewLoad ];
4950 }
5051}
@@ -77,7 +78,7 @@ - (void)setOnError:(RCTDirectEventBlock)onError {
7778 }
7879}
7980
80- - (void )setallowedTurboModules : (NSArray <NSString *> *)allowedTurboModules {
81+ - (void )setAllowedTurboModules : (NSArray <NSString *> *)allowedTurboModules {
8182 if (![allowedTurboModules isEqual: _allowedTurboModules]) {
8283 _allowedTurboModules = [allowedTurboModules copy ];
8384 [self scheduleReactViewLoad ];
@@ -99,19 +100,16 @@ - (void)scheduleReactViewLoad {
99100}
100101
101102- (void )loadReactNativeView {
102- if (_moduleName.length == 0 || _jsBundleName .length == 0 || _allowedTurboModules == nil ) {
103+ if (_moduleName.length == 0 || _jsBundleSource .length == 0 || _allowedTurboModules == nil ) {
103104 return ;
104105 }
105106
106- // TODO is it possible to get hostRtcInstance?
107-
108- SandboxReactNativeDelegate *delegate = [[SandboxReactNativeDelegate alloc ] initWithJSBundleName: _jsBundleName];
107+ SandboxReactNativeDelegate *delegate = [[SandboxReactNativeDelegate alloc ] initWithJSBundleSource: _jsBundleSource];
109108 delegate.onMessageHost = _onMessage;
110109 delegate.onErrorHost = _onError;
111110 delegate.allowedTurboModules = _allowedTurboModules;
112111
113112 RCTReactNativeFactory *factory = [[RCTReactNativeFactory alloc ] initWithDelegate: delegate];
114- factory.delegate = delegate;
115113
116114 UIView *rnView = [factory.rootViewFactory viewWithModuleName: _moduleName
117115 initialProperties: _initialProperties
0 commit comments