Skip to content

Commit

Permalink
add user account wide url protocol handler stacks-archive#240
Browse files Browse the repository at this point in the history
  • Loading branch information
larrysalibra committed Feb 24, 2017
1 parent c49191e commit 728fcea
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions native/macos/Blockstack/Blockstack/ApplicationDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@ - (void)dealloc
{
}

-(void)applicationWillFinishLaunching:(NSNotification *)aNotification
{
NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager];
[appleEventManager setEventHandler:self
andSelector:@selector(handleGetURLEvent:withReplyEvent:)
forEventClass:kInternetEventClass andEventID:kAEGetURL];
}

- (void)handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
{
NSURL *url = [NSURL URLWithString:[[event paramDescriptorForKeyword:keyDirectObject] stringValue]];
NSLog(@"Blockstack URL: %@", url);
}

- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
Expand Down
11 changes: 11 additions & 0 deletions native/macos/Blockstack/Blockstack/Blockstack-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
<string>0.3.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>blockstack</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>17</string>
<key>LSApplicationCategoryType</key>
Expand Down

0 comments on commit 728fcea

Please sign in to comment.