File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ - (void)setBridge:(RCTBridge *)bridge
25
25
{
26
26
_bridge = bridge;
27
27
28
+ [[NSAppleEventManager sharedAppleEventManager ] setEventHandler: self andSelector: @selector (getUrl:withReplyEvent: ) forEventClass: kInternetEventClass andEventID: kAEGetURL ];
29
+
28
30
[[NSNotificationCenter defaultCenter ] addObserver: self
29
31
selector: @selector (handleOpenURLNotification: )
30
32
name: RCTOpenURLNotification
@@ -54,6 +56,14 @@ + (BOOL)application:(NSApplication *)application
54
56
return YES ;
55
57
}
56
58
59
+ - (void )getUrl : (NSAppleEventDescriptor *)event withReplyEvent : (NSAppleEventDescriptor *)replyEvent
60
+ {
61
+ NSString * url = [[event paramDescriptorForKeyword: keyDirectObject] stringValue ];
62
+ NSDictionary *payload = @{@" url" : url};
63
+ [_bridge.eventDispatcher sendDeviceEventWithName: @" openURL"
64
+ body: payload];
65
+ }
66
+
57
67
+ (BOOL )application : (NSApplication *)application
58
68
continueUserActivity : (NSUserActivity *)userActivity
59
69
restorationHandler : (void (^)(NSArray *))restorationHandler
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-desktop" ,
3
- "version" : " 0.6.3 " ,
3
+ "version" : " 0.6.4 " ,
4
4
"description" : " A framework for building native desktop apps using React" ,
5
5
"license" : " BSD-3-Clause" ,
6
6
"repository" : {
You can’t perform that action at this time.
0 commit comments