Skip to content

Commit d50dcf7

Browse files
committed
remove legacy native module
1 parent bf25d39 commit d50dcf7

File tree

4 files changed

+6
-29
lines changed

4 files changed

+6
-29
lines changed
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
11
#import <Foundation/Foundation.h>
2-
3-
#import <React/RCTBridgeModule.h>
4-
5-
@interface RTAAppRegistryModule : NSObject <RCTBridgeModule>
6-
@end

ios/ReactTestApp/AppRegistryModule.mm

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,8 @@ void RTAPostDidRegisterAppsNotification(NSValue *value)
3232
userInfo:@{@"appKeys": [array copy]}];
3333
}
3434

35-
@implementation RTAAppRegistryModule
36-
37-
RCT_EXPORT_MODULE();
38-
39-
+ (BOOL)requiresMainQueueSetup
40-
{
41-
return YES;
42-
}
43-
44-
- (instancetype)init
35+
void RTAPostDidRegisterAppsNotificationWithBridge(id bridge)
4536
{
46-
if (self = [super init]) {
47-
[NSNotificationCenter.defaultCenter addObserver:self
48-
selector:@selector(javascriptDidLoadNotification:)
49-
name:RCTJavaScriptDidLoadNotification
50-
object:nil];
51-
}
52-
return self;
53-
}
54-
55-
- (void)javascriptDidLoadNotification:(NSNotification *)note
56-
{
57-
id bridge = note.userInfo[@"bridge"];
5837
if (![bridge isKindOfClass:[RCTCxxBridge class]] ||
5938
![bridge respondsToSelector:@selector(runtime)] ||
6039
![bridge respondsToSelector:@selector(invokeAsync:)]) {
@@ -71,5 +50,3 @@ - (void)javascriptDidLoadNotification:(NSNotification *)note
7150
RTAPostDidRegisterAppsNotification([NSValue valueWithPointer:runtime]);
7251
}];
7352
}
74-
75-
@end

ios/ReactTestApp/Public/ReactTestApp-DevSupport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ OBJC_EXTERN NSNotificationName const ReactTestAppSceneDidOpenURLNotification
2323
OBJC_EXTERN NSNotificationName const ReactInstanceDidLoadBundle;
2424

2525
OBJC_EXTERN void RTAPostDidRegisterAppsNotification(NSValue *runtime);
26+
OBJC_EXTERN void RTAPostDidRegisterAppsNotificationWithBridge(id bridge);
2627

2728
NS_ASSUME_NONNULL_END

ios/ReactTestApp/ReactInstance.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ final class ReactInstance: NSObject, RNXHostConfig {
218218
})
219219
#endif
220220
}
221+
222+
if let bridge = notification.userInfo?["bridge"] {
223+
RTAPostDidRegisterAppsNotificationWithBridge(bridge)
224+
}
221225
}
222226

223227
@objc

0 commit comments

Comments
 (0)