Normally, if a URL-handling app is not running, and user visits a URL with that 
app's scheme, Mac OS X launches the app.  My app's URL handler only works when 
my app is running.  That's not so bad, but I have one user reporting that it 
*never* works.  I presume the issues are related and need to understand what's 
going on.

If I "visit" a URL with my app's scheme in Safari, while my app is *not* 
running, Safari displays a page saying "Safari can't open … because OS X 
doesn't recognize internet addresses starting with <myUrlScheme>".

I understand that registered URL schemes are persisted in Launch Services plist 
files.  When I run this command…

defaults read com.apple.LaunchServices LSHandlers | grep LSHandlerURLScheme

I get about 20 URL schemes: http, https, mailto, github-mac, etc., including 
some targeting apps that I haven't used in years.  But my app's url scheme 
*never* shows up in there.  Why not?

Now, my app itself does not handle the URL directly.  The URL handler is 
actually installed in a faceless helper app which is in the main app's 
Contents/Helpers/ directory.  (This was done so I could control whether or not 
my app is activated.)  Here is the code:

NSAppleEventManager *appleEventManager = [NSAppleEventManager 
sharedAppleEventManager] ;
[appleEventManager setEventHandler:self
                       andSelector:@selector(handleGetURLEvent:withReplyEvent:)
                     forEventClass:kInternetEventClass
                        andEventID:kAEGetURL] ;    

Also, the trouble started with this particular user when he installed an update 
in which I had changed the *name* of the helper.  So I was wondering if maybe 
Launch Services still had the old name, but that's when I found out that in 
fact it had neither.

Why might my URL handler not be persistent?

Thanks,

Jerry Krinock
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to