Launching CefSimple OSX with a custom URL

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Launching CefSimple OSX with a custom URL

Postby coder678 » Wed May 09, 2018 1:09 am

I am writing a custom app based on CefSimple example on MacOS. I want to be able to open the app via url mysuperapp://?p1=1&p2=2&p3=3 . I need to parse parameters. Normally such thing is done in applicationWillFinishLaunching method:
Code: Select all
-(void)applicationWillFinishLaunching:(NSNotification *)aNotification
{
    NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager];
    [appleEventManager setEventHandler:self
                           andSelector:@selector(handleGetURLEvent:withReplyEvent:)
                         forEventClass:kInternetEventClass andEventID:kAEGetURL];
}
 
- (void)handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
{
    NSURL *url = [NSURL URLWithString:[[event paramDescriptorForKeyword:keyDirectObject] stringValue]];
}


But in CefSimple this method is not firing. So my question is: where can I put the above code to be able to parse parameters if url is opened when my app is closed? Because it works if the app is already opened if I put this code in (void)createApplication:(id)object method.
coder678
Techie
 
Posts: 35
Joined: Sun Jun 26, 2016 10:03 pm

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 41 guests