Launch application from custom URL

Discussion in 'Mac Programming' started by paos, Sep 18, 2009.

  1. paos macrumors newbie

    Joined:
    Aug 13, 2009
    #1
    Hi, I'm trying to launch my application from a custom URL, I've already registered it on info.plist URL schemes, on iPhone sdk there's a UIApplication method:

    - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url

    which lets me handle this from AppDelegate, I've been looking for something like this on NSApplication documentation but couldn't find anything.
    Actually, my application launches after clicking on the custom url, but I have some code that needs to be executed after application launches and can't figure out how to do this.
    Does someone have any idea of how to do this?
    thanks!
     
  2. paos thread starter macrumors newbie

    Joined:
    Aug 13, 2009
    #2
    Hi , I solved my problem registering the appleEvent and handling from my app using:
    - (void)handleGetURLEvent: (NSAppleEventDescriptor *)event withReplyEvent: (NSAppleEventDescriptor *)replyEvent

    It works fine when I launch my app from an URL on Mail Application, but when I try to launch from an URL o safari (lets say from a gmail client) nothing happens , any idea??
     
  3. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #3
    I'm not on a Mac to check right now but iirc Safari has a preference about launching "safe" URLs in external apps...
     

Share This Page