-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register the desktop app path with launch services (#1731)
- Loading branch information
1 parent
8e5c472
commit ed17220
Showing
3 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//go:build darwin | ||
// +build darwin | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
BOOL registerAppBundle(char *cAppBundlePath) { | ||
NSString *appBundlePath = [NSString stringWithUTF8String:cAppBundlePath]; | ||
CFURLRef url = (CFURLRef)[NSURL fileURLWithPath:appBundlePath]; | ||
|
||
// Set inUpdate to true to ensure app gets updated | ||
OSStatus status = LSRegisterURL((CFURLRef)url, YES); | ||
|
||
if (status != noErr) { | ||
NSLog(@"could not register app bundle: LSRegisterURL returned error: %jd", (intmax_t)status); | ||
return NO; | ||
} | ||
|
||
return YES; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...esktop/user/universallink/handler_test.go → .../user/universallink/handler_other_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//go:build !darwin | ||
// +build !darwin | ||
|
||
package universallink | ||
|
||
import ( | ||
|