Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Is applicationDidFinishLaunching: guaranteed to be called before INIntent delegate methods when app is launched via a Shortcut?

I have a question about the app lifecycle when my app is launched via a Shortcut. I'm adding a INIntent to a Mac app. So my app delegate implements:

- (nullable id)application:(NSApplication *)application handlerForIntent:(INIntent *)intent

Then my custom intent handler implements the two protocol methods -confirmIntentNameHere:completion: and -handleIntentNameHere:completion:

During my testing -applicationDidFinishLaunching: is called before the intent methods, so I can forward methods to my main window controller to perform the shortcut actions, since it's already ready.

....But if this is not always the case, I can still perform them but I'd have to move the code out of the window controller to perform the action "headless" if invoked before my app has built its UI. Just wondering if this is something I should be prepared for.

Thanks in advance.

I ended up refactoring my code so I can handle the possibility of performing the intent action before the main window controller is loaded even if it isn't possible (I wouldn't want to instantiate it in the intent handler action because I don't want to interfere with certain logic in app launch). Probably should have designed it this way from the beginning anyway, the action doesn't need to be tied to the window controller.

Still would like to know about app lifecycle here out of curiosity

Is applicationDidFinishLaunching: guaranteed to be called before INIntent delegate methods when app is launched via a Shortcut?
 
 
Q