I am trying to create an Intents Extension for macOS 12 Monterey.
What I've done:
func handler(for intent: INIntent) -> Any
Problem:
My shortcut action does appear in Shortcuts. However, ever time I run a shortcut with my action, the main app launches and not the extension itself.
I've been able to figure out what I was doing wrong, look at my answer below. 👇
I've found two possible causes for this:
info.plist
) as you only have to do this if you want your main app to handle the intent via func application(_ application: NSApplication, handlerFor intent: INIntent) -> Any?
. in the app delegate (a.k.a. in-app handling) - you want your extension to handle the intentApp Sandbox
in the build settings and add an entitlements file with com.apple.security.app-sandbox
set to true
. Apple should really do this for any new Intent Extension by default.Cheers!