View Full Version : Registing a URL handler with your application

Jun 2, 2009, 08:10 AM
I want to add URL handler for my application. On searching google, I found some information.
In my application, I am following the procedure mentioned in the website Registering URL handler (http://www.cocoadev.com/index.pl?HowToRegisterURLHandler)

In the method

- (void)getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent

I just added "NSLog" statement to print the URL and monitoring the console log.

I compiled the code in "Release" mode. Now for running the application, I open safari browser and entered "myapp://some_action_or_resource", then press "Enter". Now its opening the application.
I expected "some_action_or_resource" in the console log.
But its not printing the URL. Do I have to do anything in addition to get the URL printed in console log. If I get the URL, I will do other processing needed.

Jun 3, 2009, 01:38 AM
I found the solution.

In my code I am registering the event in applidcationDidFinishLaunching.
To solve this issue, it must be done in "init" method.