Executing the default handler for OSX 10.10 with sandboxing enabled
I couldn't find anything online, but LSSetDefaultHandlerForURLScheme will return -54 when sandboxing is enabled. I'm not sure if you need to enable permissions for this to work the same as without sandboxing.
To see it, create a new project with this in the appdelegate:
-(void)applicationWillFinishLaunching:(NSNotification *)notification {
// Become default handler
CFStringRef bundleID = (CFStringRef)CFBridgingRetain([[NSBundle mainBundle] bundleIdentifier]);
OSStatus result = LSSetDefaultHandlerForURLScheme(CFSTR("maxel"), bundleID);
if (result != 0) {
assert(0);
}
}
It will work. Then turn on the sandbox. This will result in a -54 error.
Built on OSX 10.10 Yosemite. Does anyone else come across this?
+3
source to share