Sirikit - Adding Siri custom intent to a framework

I've seen many articles which demonstrate : "How to add Siri extension to my app" and "Create shared framework to share code between apps & extension"

My questions and my need is exactly as mentioned into the title : Is it possible to add Siri custom intent to a framework (and not an app) ? If yes, How ? So I can build an App using my framework containing all the intent possible tu use.

For the moment, I've succeeded to configure and use a swiftui "Add to siri Button". The right intent is presented to me, well, I can tap on "Add to Siri". But then, the error: "The operation couldn't be completed. (WFActionError-Domain error1)" appears when I try to use my shortcut inside the shortcut App

Using intents from a framework is fine — for example, the SoupChef sample code project does this.

This error you're seeing might not have anything to do with your framework and is likely an issue with the IntentsUI framework. We'd appreciate if you could give us the details of this issue through a bug report created in Feedback Assistant. Can you please take your small sample project, as well as the full text of the error, and attach it to the bug report? Please post the FB number here so we can follow-up on it.

Thanks for answering and indeed it helps me a little, about some things.

Hope you can help me for this last issue because I think if a solution exists, it is definitely the last one.

I created a project, a simple app, and an extension with a custom intent as simple as possible. I compiled it, created a new project and dragged & dropped my .appex to this new project. First error I could faced was the extension's bundle ID different from the parent app : I succeeded to change it thanks to a pre-build script. The problem is that now, I cannot access my custom intent "Test" from the main app. It doesn't appear. From my first app, I had to make my intent definition file "public intent classes" for both extension and app, to get access of my custom intents. The thing is, now that I want to embed my extension into an other project, I cannot change that.

Hope you understood my problem

Sharing a compiled .appex is not going to work for a variety of reasons, as you found. To share a pre-compiled binary, you must do so as an XCFramework. See Binary Frameworks in Swift and Create an XCFramework to understand how to create one.

Sirikit - Adding Siri custom intent to a framework
 
 
Q