App Intents

RSS for tag

Extend your app’s custom functionality to support system-level services, like Siri and the Shortcuts app.

Posts under App Intents tag

200 Posts

Post

Replies

Boosts

Views

Activity

Receiving an on‑screen image from another app via App Intents / Siri (app has no photo library)
I have a photo editing app that owns no photo library. I want a user viewing an image in another app (e.g. Photos) to say "filter this image in MyApp" and have Siri hand that on‑screen image to my intent. Targeting iOS 27. What I've tried, and the result in each case: • App Shortcut + @Parameter var image: IntentFile — Siri resolves my other parameters (a filter AppEnum) by voice, but never binds the image; the run fails. • @AppIntent(schema: .photos.setFilter) with a .photos.asset entity — never routes from Photos. • @AppIntent(schema: .system.open): OpenIntent with a custom AppEntity target — "Open this image in MyApp" just launches the app by name; perform() is never called, and the entity query never runs. My understanding from WWDC26 "Build intelligent Siri experiences with App Schemas" (session 240) and "Discover new capabilities in the App Intents framework" (session 345): • Cross‑app content transfer (Transferable + IntentValueRepresentation) seems limited to system value types (IntentPerson, PlaceDescriptor); IntentFile is not a _SystemIntentValue, so an image can't ride that rail. • Onscreen awareness (NSUserActivity.appEntityIdentifier, View Annotations) appears to expose only the foreground app's own content — which here is Photos, not me. Question: Is there a supported way for a third‑party app to receive another app's on‑screen image (vs. a contact/place) through Siri/App Intents today? If so, which API carries the pixels — an IntentFile parameter, @UnionValue, IntentValueQuery, something else — and what must the source app do to make it available? Or is asking "do X to this image in <third‑party app>" simply not supported yet outside Shortcuts?
4
1
1.2k
6d
Siri AI + Schema .system.open
Since iOS 18, I have an OpenIntent to open documents. For Siri AI, I understood that I need to annotate the entity with @AppIntent(schema: .system.open) for Siri AI to be able to open documents. This is only supported starting with iOS 27. I tried duplicating the intent (one for iOS 27, one for the other versions), however, Xcode complains and says that only one OpenIntent is possible per target entity. How are we supposed to: support Siri AI "open" functionality preserve functionality for older iOS versions ? Thank you
1
2
484
6d
OpenIntent vs .system.open App Schema: Which should be used for opening entities on iOS 27 and later?
I'm trying to understand the intended relationship between OpenIntent and the new .system.open App Intent schema introduced in iOS 27. From the documentation: OpenIntent (available since iOS 16) is described as an intent that opens an associated item. iOS 27 introduces the .system.open schema, which also appears to represent opening an entity or piece of app content. My questions are: For an app that supports iOS 27+, is .system.open intended to replace OpenIntent, or do the two serve different purposes? For apps that support both iOS 26 and iOS 27+, is the recommended approach to have two structs that implement the same opening logic, one with @AppIntent(schema: .system.open) and the other implementing the OpenIntent protocol? Thanks! References: open protocol OpenIntent
3
0
1.6k
6d
Xcode 27 beta: @AppEntity(schema: .photos.asset) now requires iOS 27 (compiled for iOS 18 in Xcode 26)
Filed as FB23652582. In Xcode 27 beta, this no longer compiles when the deployment target is below iOS 27: @available(iOS 18.0, *) @AppEntity(schema: .photos.asset) struct AssetEntity: IndexedEntity { ... } // error: 'asset' is only available in iOS 27.0 or newer The identical source compiles under Xcode 26. It looks like the @AppEntity(schema:) macro now resolves .photos.asset to a declaration annotated for iOS 27, whereas in Xcode 26 it resolved to the (now-deprecated) iOS 16 declaration. What seems off: the .photos.album entity in the same domain still builds fine at an iOS 18 deployment target — only .asset requires iOS 27. That asymmetry is what makes me think it may be an unintended availability change rather than a deliberate one. Has anyone else hit this? And is this intended — i.e. is .photos.asset now meant to be iOS 27+ only, or should it still be usable from apps that deploy to iOS 18?
2
2
799
1w
Is there any public way to create a pre-filled note in Notes.app from a third-party iOS app?
I'm building a cross-platform app (.NET MAUI) on ios with a feature that lets users send a block of text to their preferred note-taking app to save for later. This works fine via their documented x-callback-url schemes (e.g. bear://x-callback-url/create?text=...). I'd like to support Apple's own Notes app the same way, but I can't find a documented mechanism to do so. Questions: Is there a URL scheme for Notes.app that a third-party app can use to open it, and if so, does it support passing in content for a new note? Is there any officially supported way — App Intents, or otherwise — to create a new note with pre-filled text in Notes.app from another app? Does the new Notes domain under App Intents (iOS 18+) apply to Apple's own Notes app, or is it purely a schema that third-party note apps can adopt for themselves? If it does apply, is there a way to invoke it directly from another app's UI rather than only via Siri/Shortcuts? If none of the above exists, is routing through the standard share sheet the intended/only supported approach for this use case going forward? Thanks in advance — wanting to make sure I'm not missing a documented mechanism before concluding this isn't possible.
1
0
235
2w
Is Siri AI unavailable to users or developers in European Union (EU)?
Hello, I'm a EU-based developer. Our app is distributed worldwide. I'd like to clarify the following regarding Siri AI and EU: is Siri AI unavailable to users based in EU, or to apps based in EU. In other words, will my app developed in Europe work with Siri AI for US users? Or the fact that my app is developed in Europe excludes it from compatibility with Siri AI? Kind regards, Bruno
1
0
720
2w
AppIntent CreateReminder schema doesn't work
My intents and entities show up in Shortcuts, and my tests that use App Intents Framework pass. But I can't for the life of me figure out why Siri won't work. I'm trying phrases like "Add to my list in ". All I ever get from Siri is variations of "I can't add items directly to " or "I can't add items to your lists in ". Does anyone see any issues with the following? ( I've left out some of the AppEnum and Entity types for brevity, but these are the main ones) @AppIntent(schema: .reminders.createReminder) struct AddToListIntent { var title: String var list: ListEntity? var note: AttributedString? var isFlagged: Bool? var images: [IntentFile] var tags: Set<String> var urls: [URL] var dueDate: DateComponents? var recurrence: Calendar.RecurrenceRule? var locationTrigger: LocationTriggerEntity? var section: SectionEntity? func perform() async throws -> some ReturnsValue<ReminderEntity> { let newReminder = ReminderEntity(id: "foo", reminder: .init(name: title)) return .result(value: newReminder) } } struct Reminder { var name: String } @AppEntity(schema: .reminders.reminder) struct ReminderEntity { // MARK: Static static let defaultQuery = ReminderEntityQuery() // MARK: Properties let id: String let reminder: Reminder @ComputedProperty(title: "Title") var title: String { reminder.name } var note: AttributedString? { nil } var tags: Set<String> { Set() } var urls: [URL] { [] } var dueDate: DateComponents? { nil } var recurrence: Calendar.RecurrenceRule? { nil } var isCompleted: Bool { false } var isFlagged: Bool? { nil } var creationDate: Date? { nil } var completionDate: Date? { nil } var list: ListEntity var locationTrigger: LocationTriggerEntity? { nil } var displayRepresentation: DisplayRepresentation { .init(title: "\(title)") } // MARK: Query struct ReminderEntityQuery: EntityQuery, EnumerableEntityQuery { func entities(for identifiers: [ReminderEntity.ID]) async throws -> [ReminderEntity] { identifiers.map { .init(id: $0, reminder: .init(name: "Foo")) } } func allEntities() async throws -> [ReminderEntity] { ["foo", "bar", "baz"].map { ReminderEntity(id: $0, reminder: .init(name: $0)) } } } } @AppEntity(schema: .reminders.list) struct ListEntity: AppEntity, IndexedEntity { let id: String let myName: String var name: String { myName } // 3. Define how this entity is displayed to the user in shortcuts/Siri var displayRepresentation: DisplayRepresentation { DisplayRepresentation(title: "\(myName)") } @Property var type: MyListType // 4. Provide a query so the system can resolve specific lists static var defaultQuery = ListEntityQuery() }
1
0
162
2w
App Shortcuts Action button default parameter
Hello, I have a question about App Intents and the Action button on iPhone. I have an App Intent that opens the app and navigates to a specific entity, conforming to OpenIntent with a single AppEntity parameter. The entity conforms to EnumerableEntityQuery, and the intent is registered as an App Shortcut via the AppShortcutsProvider. When assigning this shortcut to the Action button in Settings, the system doesn’t prompt the user to select a default entity upfront. Instead, it prompts on every activation, creating friction. In contrast, shortcuts like “Open Note…” and other third-party ones prompt the user for a note to open when setting up the Action button, and its title also includes three dots, indicating a pre-configurable parameter. My shortcut’s title shows no dots. What’s required to make an App Shortcut prompt for a default parameter during Action button setup? Sincerely, Holger
4
0
1.2k
2w
PSA: `.photos.editAsset` fails unless the entity type is named `AssetEntity` on iOS 27
We found an apparent iOS 27 WorkflowKit bug when implementing: @AppIntent(schema: .photos.editAsset) with an entity conforming to: @AppEntity(schema: .photos.asset) Despite Apple’s general guidance that schema entity types may be renamed, Siri only worked when our entity’s Swift type was named exactly AssetEntity. Controlled on-device results: AssetEntity — works PhotoAssetEntity — fails FooAssetEntity — fails For the failing names, neither the entity query nor perform() was reached. WorkflowKit logged: Failed to retrieve entity metadata Error Domain=WFActionErrorDomain Code=6 Siri responded: Unable to retrieve the data information to process. The generated App Intents metadata was internally consistent, and the issue persisted across clean installs and a device restart. Current workaround: name the .photos.asset entity type exactly AssetEntity. Tested with Xcode 27.0 beta (27A5252f) and iPadOS 27.0 (24A5423a). Filed with Apple as FB24604095 for anyone from Apple investigating this behavior.
0
2
142
2w
Confusing relationship between attributeSet, defaultAttributeSet, and displayRepresentation
I’m trying to understand the intended relationship between IndexedEntity.attributeSet, defaultAttributeSet, and displayRepresentation. For example: struct TrailEntity: IndexedEntity { var displayRepresentation: DisplayRepresentation { DisplayRepresentation( title: "(trail.name)", subtitle: "(trail.location)" ) } var attributeSet: CSSearchableItemAttributeSet { let attributes = CSSearchableItemAttributeSet() attributes.keywords = trail.keywords return attributes } } Should attributeSet instead be initialized with defaultAttributeSet and then have the additional attributes assigned to it? var attributeSet: CSSearchableItemAttributeSet { let attributes = defaultAttributeSet attributes.keywords = trail.keywords return attributes } The documentation says defaultAttributeSet contains values derived from displayRepresentation, but it also describes precedence between displayRepresentation and attributeSet, which suggests Spotlight reads them separately during indexing. So what is the intended pattern? Does overriding attributeSet require including defaultAttributeSet to preserve title/subtitle/image metadata, or is attributeSet only meant for additional Core Spotlight metadata? If the latter, what is the intended use case for overriding or directly using defaultAttributeSet?
1
0
168
3w
AppShortcutsProvider not detected by the Shortcuts app – app built entirely with Swift Playgrounds + TestFlight
Context I built an app entirely using Swift Playgrounds on iPad (no access to a Mac / Xcode). The app is distributed via TestFlight and installed on an iPhone. Problem I implemented an AppShortcutsProvider with simple AppShortcut entries (code below), but no shortcuts show up in the Shortcuts app, in the list of apps with shortcuts, or via Siri. What I've already tried without success: Full restart of the iPhone Deleting the app's data Fully uninstalling and reinstalling the app A new TestFlight build (with incremented build number) after adding the code Confirming the phrases correctly include (.applicationName) as required Question Is the Extract AppIntentsMetadata build step (which generates the metadata.appintents file) actually executed when compiling/submitting via Swift Playgrounds on iPad, or is this a known limitation of the tool that would prevent App Shortcuts from being indexed by Shortcuts/Siri? Environment Swift Playgrounds version: [check in the app under Settings > General > About] iOS version on test iPhone: [fill in] Project deployment target: [fill in if known, otherwise note that you have no way to check this without Xcode] Provider code: import SwiftUI import AppIntents // ============================================================ // MARK: - TEST INTENT // ============================================================ struct TestExpenseIntent: AppIntent { static let title: LocalizedStringResource = "Test dépense" static let description = IntentDescription( "Teste l'intégration de l'application avec Raccourcis." ) static let isDiscoverable = true func perform() async throws -> some IntentResult { return .result(dialog: "Ça fonctionne !") } } // ============================================================ // MARK: - ADD EXPENSE INTENT // ============================================================ struct AddApplePayExpenseIntent: AppIntent { static let title: LocalizedStringResource = "Ajouter une dépense" static let description = IntentDescription( "Ajoute une dépense à un Tricount." ) static let isDiscoverable = true static let openAppWhenRun = false @Parameter(title: "Montant") var amount: Double? @Parameter(title: "Marchand") var merchant: String? func perform() async throws -> some IntentResult { let valAmount = amount ?? 0.0 let valMerchant = merchant ?? "Inconnu" print("Montant :", valAmount) print("Marchand :", valMerchant) return .result( dialog: "Dépense de \(valAmount) € chez \(valMerchant)." ) } } // ============================================================ // MARK: - SHORTCUTS // ============================================================ struct MyAppShortcuts: AppShortcutsProvider { static var shortcutTileColor: ShortcutTileColor = .blue static let appShortcuts: [AppShortcut] = [ AppShortcut( intent: TestExpenseIntent(), phrases: [ "Tester \(.applicationName)" ], shortTitle: "Test dépense", systemImageName: "plus.circle" ), AppShortcut( intent: AddApplePayExpenseIntent(), phrases: [ "Ajouter une dépense dans \(.applicationName)", "Ajouter \(\.$amount) dans \(.applicationName)" ], shortTitle: "Ajouter une dépense", systemImageName: "plus.circle" ) ] }
1
0
260
3w
Adding an OptionsCollection to an existing AppShortcut hides all other parameterless App Shortcuts from the Shortcuts app UI
Hi all, I’m seeing what looks like a bug with AppShortcutParameterPresentation and the Shortcuts app. Any time I provide an OptionsCollection to a shortcut so I can give it a nice category name and symbol in Shortcuts, it hides all other existing app shortcuts that my app has from the UI. I have created a sample that illustrates the problem. My app provides two App Shortcuts: A simple shortcut with no parameters. A shortcut with two parameters. Its Destination parameter uses AppShortcutParameterPresentation to generate “Home” and “Office” options in a separate section. When the second shortcut is present, the first parameterless shortcut disappears from the Shortcuts app. If I comment out the shortcut containing parameterPresentation, the parameterless shortcut appears again. Before commenting out: After commenting out the second shortcut: Here's the code: import AppIntents struct ParameterlessIntent: AppIntent { static let title: LocalizedStringResource = "Parameterless Intent" static let description = IntentDescription("Runs without asking for any parameters.") func perform() async throws -> some IntentResult { .result() } } struct ParameterizedIntent: AppIntent { static let title: LocalizedStringResource = "Parameterized Intent" static let description = IntentDescription("Runs with a destination and a copy count.") // The same provider is used by this parameter and by ParameterPresentation below. @Parameter( title: "Destination", optionsProvider: DestinationOptionsProvider() ) var destination: String @Parameter(title: "Copy Count", default: 1) var copyCount: Int static var parameterSummary: some ParameterSummary { Summary("Send \(\.$copyCount) copies to \(\.$destination)") } func perform() async throws -> some IntentResult { .result() } } nonisolated struct DestinationOptionsProvider: DynamicOptionsProvider { func results() async throws -> [String] { // Each generated App Shortcut option is a value for the Destination parameter. ["Home", "Office"] } } struct BugReproductionShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { // This parameterless shortcut should always appear in the Shortcuts app. AppShortcut( intent: ParameterlessIntent(), phrases: [ "Run the parameterless shortcut with \(.applicationName)" ], shortTitle: "Do I exist?", systemImageName: "1.circle" ) #warning("The presence of this shortcut causes the top one no longer appear in Shortcuts.app") AppShortcut( intent: ParameterizedIntent(), phrases: [ "Run the parameterized shortcut with \(.applicationName)" ], shortTitle: "Parameterized Shortcut", systemImageName: "2.circle", parameterPresentation: ParameterPresentation( for: \.$destination, summary: Summary("Send to \(\.$destination)") ) { // This title and symbol create a separate section in Shortcuts. OptionsCollection( DestinationOptionsProvider(), title: "Destination Shortcuts", systemImageName: "mappin.and.ellipse" ) } ) } } This code and reproduction is as of Xcode 27 Beta 6 and happens on older versions as well. Is there a known limitation with this or is this somehow expected behavior? If so, how can I mitigate this issue and provide a nice title for another shortcut, while keeping the old parameterless shortcuts present? Thanks!
1
0
446
3w
UIKit AppIntentSceneDelegate: connectionOptions.appIntent is nil on cold launch (iOS Beta) -
Hi everyone, I am currently implementing the new Search API in a UIKit app using @AppIntent(schema: .system.search), ShowInAppSearchResultsIntent, and UISceneAppIntent. While testing on the iOS beta, I’ve hit a significant lifecycle disparity between how UIKit and SwiftUI apps process system intents during a process-cold launch. According to the documentation for UIScene.ConnectionOptions.appIntent, this property should contain the intent that triggered the scene creation. However, in a UIKit app with a single-window scene lifecycle, this isn't happening consistently. Here is the behaviour breakdown I am seeing: Cold Launch (Siri/Search → App completely closed) SwiftUI App: Works as documented. The intent is present in connection options. scene(_:willPerformAppIntent:) is not called. UIKit App (with AppIntentSceneDelegate): The connectionOptions.appIntent property is completely nil inside scene(:willConnectTo:options:). Instead, the intent is delivered late via scene(:willPerformAppIntent:) right after scene connection completes. Warm Launch (Siri/Search → App already suspended in memory) Both SwiftUI and UIKit: Behave identically. The intent is delivered directly to scene(_:willPerformAppIntent:). The Problem Because of this gap, there is no unified way to handle a process-cold launch under UIKit. There is no LaunchOptionsKey available to identify that an App Intent initiated the launch, and the missing connection option forces us to bifurcate our routing logic. I have already filed a bug report via Feedback Assistant: FB24513291 and attached a minimal reproducible sample project. Has anyone else run into this specific AppIntentSceneDelegate race condition on the iOS beta? If so, what architecture or unified pattern are you using to normalize the lifecycle routing between cold and warm launches in UIKit? Any insights or clean workaround ideas would be highly appreciated!
0
0
408
3w
AppShortcutsProvider not detected by the Shortcuts app – app built entirely with Swift Playgrounds
Context I built an app entirely using Swift Playgrounds on iPad (no access to a Mac / Xcode). The app is distributed via TestFlight and installed on an iPhone. Problem I implemented an AppShortcutsProvider with simple AppShortcut entries (code below), but no shortcuts show up in the Shortcuts app, in the list of apps with shortcuts, or via Siri. What I've already tried without success: Full restart of the iPhone Deleting the app's data Fully uninstalling and reinstalling the app A new TestFlight build (with incremented build number) after adding the code Confirming the phrases correctly include (.applicationName) as required Question Is the Extract AppIntentsMetadata build step (which generates the metadata.appintents file) actually executed when compiling/submitting via Swift Playgrounds on iPad, or is this a known limitation of the tool that would prevent App Shortcuts from being indexed by Shortcuts/Siri? Provider code: import SwiftUI import AppIntents // ============================================================ // MARK: - TEST INTENT // ============================================================ struct TestExpenseIntent: AppIntent { static let title: LocalizedStringResource = "Test dépense" static let description = IntentDescription( "Teste l'intégration de l'application avec Raccourcis." ) static let isDiscoverable = true func perform() async throws -> some IntentResult { return .result(dialog: "Ça fonctionne !") } } // ============================================================ // MARK: - ADD EXPENSE INTENT // ============================================================ struct AddApplePayExpenseIntent: AppIntent { static let title: LocalizedStringResource = "Ajouter une dépense" static let description = IntentDescription( "Ajoute une dépense à un Tricount." ) static let isDiscoverable = true static let openAppWhenRun = false @Parameter(title: "Montant") var amount: Double? @Parameter(title: "Marchand") var merchant: String? func perform() async throws -> some IntentResult { let valAmount = amount ?? 0.0 let valMerchant = merchant ?? "Inconnu" print("Montant :", valAmount) print("Marchand :", valMerchant) return .result( dialog: "Dépense de \(valAmount) € chez \(valMerchant)." ) } } // ============================================================ // MARK: - SHORTCUTS // ============================================================ struct MyAppShortcuts: AppShortcutsProvider { static var shortcutTileColor: ShortcutTileColor = .blue static let appShortcuts: [AppShortcut] = [ AppShortcut( intent: TestExpenseIntent(), phrases: [ "Tester (.applicationName)" ], shortTitle: "Test dépense", systemImageName: "plus.circle" ), AppShortcut( intent: AddApplePayExpenseIntent(), phrases: [ "Ajouter une dépense dans (.applicationName)", "Ajouter (.$amount) dans (.applicationName)" ], shortTitle: "Ajouter une dépense", systemImageName: "plus.circle" ) ] }
0
0
241
3w
Spotlight on finds title attribute (OS27 b3)
Hi, it seems that something in OS27b3 changed regarding Core Spotlight: Whatever I try, Siri and Spotlight only seem to find the text inside the title or displayName attribute. But attributes like textContent or contentDescription or keywords seem to be ignored. Those attributes are still found, when I do a manual search using CSUserQuery or using the AppEntityDefinition.spotlightQuery(_:) in App Intent Testing. I have already filed a Feedback – but wonder whether anyone else is having this issue? FB23635795 Thanks, Friedrich
4
0
766
3w
Are `NSTableViewAppIntentsDataSource` data source methods expected to be called?
I've looked and looked and can't seem to find anything obviously wrong, so I'll ask here. Are NSTableViewAppIntentsDataSource protocol methods expected to be called? Have others had success with this? I've got an extremely trivial NSViewController subclass that conforms to NSTableViewDataSource, NSTableViewDelegate, NSTableViewAppIntentsDataSource. Things I've verified: The NSTableView is setup in a storyboard and the delegate and data source are connected to the view controller. In viewDidLoad while attached to the debugger I see this works. The table view includes a single row and appears populated when running the app. There seems to be no way to assign the appIntentsDataSource view controller in the storyboard, so that's assigned in code in viewDidLoad for the view controller. I can confirm it's correctly set in the data source methods for the table view. I have an AppEntity conforming type and AppIntentsPackage conforming type in the project. I can look at the actionsdata in the built product to confirm the entity is registered. Here's the entirety of the view controller: class ViewController: NSViewController, NSTableViewDataSource, NSTableViewDelegate, NSTableViewAppIntentsDataSource { @IBOutlet var tableView: NSTableView! func numberOfRows(in tableView: NSTableView) -> Int { print("numberOfRows(in:)") return 1 } dynamic public func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? { print("tableView(_:objectValueFor:row:)") return NSObject() } override func viewDidLoad() { super.viewDidLoad() tableView.appIntentsDataSource = self } override var representedObject: Any? { didSet { // Update the view, if already loaded. } } dynamic public func tableView(_ tableView: NSTableView, appEntityIdentifierFor row: Int) -> EntityIdentifier? { print("ViewController.tableView(_:appEntityIdentifierFor:)") return EntityIdentifier(for: MyFancyEntity.self, identifier: "1234") } } Unfortunately, while attached with a debugger, ViewController.tableView(_:appEntityIdentifierFor:) just never seems to be called.
0
0
319
Aug ’26
Group AppIntents’ Searchable DynamicOptionsProvider in Sections
I’m trying to group my EntityPropertyQuery selection into sections as well as making it searchable. I know that the EntityStringQuery is used to perform the text search via entities(matching string: String). That works well enough and results in this modal: Though, when I’m using a DynamicOptionsProvider to section my EntityPropertyQuery, it doesn’t allow for searching anymore and simply opens the sectioned list in a menu like so: How can I combine both? I’ve seen it in other apps, but can’t figure out why my code doesn’t allow to section the results and make it searchable? Any ideas? My code (simplified) struct MyIntent: AppIntent { @Parameter(title: "Meter"), optionsProvider: MyOptionsProvider()) var meter: MyIntentEntity? // … struct MyOptionsProvider: DynamicOptionsProvider { func results() async throws -> ItemCollection<MyIntentEntity> { // Get All Data let allData = try IntentsDataHandler.shared.getEntities() // Create Arrays for Sections let fooEntities = allData.filter { $0.type == .foo } let barEntities = allData.filter { $0.type == .bar } return ItemCollection(sections: [ ItemSection("Foo", items: fooEntities), ItemSection("Bar", items: barEntities) ]) } } struct MeterIntentQuery: EntityStringQuery { // entities(for identifiers: [UUID]) and suggestedEntities() functions func entities(matching string: String) async throws -> [MyIntentEntity] { // Fetch All Data let allData = try IntentsDataHandler.shared.getEntities() // Filter Data by String let matchingData = allData.filter { data in return data.title.localizedCaseInsensitiveContains(string)) } return matchingData } }
2
2
1.5k
Aug ’26
AppIntent ignores registered dependencies when awaited
App intent has a perform method that is async and can throw an error, but I can't find a way to actually await the result and catch the error if needed. If I convert this working but non-waiting, non-catching code: Button("Go", intent: MyIntent()) to this (so I can control awaiting and error handling): Button("Go") { Task { do { try await MyIntent().perform() // 👈 } catch { print(error) } } } It crashes: AppDependency with key "foo" of type Bar.Type was not initialized prior to access. Dependency values can only be accessed inside of the intent perform flow and within types conforming to _SupportsAppDependencies unless the value of the dependency is manually set prior to access. Although it is invalid since the first version is working like a charm and dependencies are registered in the @main App init method and it is in the perform flow. So how can we await the result of the AppIntent and handle the errors if needed in the app? Should I re-invent the Dependency mechanism?
1
0
1k
Aug ’26
Receiving an on‑screen image from another app via App Intents / Siri (app has no photo library)
I have a photo editing app that owns no photo library. I want a user viewing an image in another app (e.g. Photos) to say "filter this image in MyApp" and have Siri hand that on‑screen image to my intent. Targeting iOS 27. What I've tried, and the result in each case: • App Shortcut + @Parameter var image: IntentFile — Siri resolves my other parameters (a filter AppEnum) by voice, but never binds the image; the run fails. • @AppIntent(schema: .photos.setFilter) with a .photos.asset entity — never routes from Photos. • @AppIntent(schema: .system.open): OpenIntent with a custom AppEntity target — "Open this image in MyApp" just launches the app by name; perform() is never called, and the entity query never runs. My understanding from WWDC26 "Build intelligent Siri experiences with App Schemas" (session 240) and "Discover new capabilities in the App Intents framework" (session 345): • Cross‑app content transfer (Transferable + IntentValueRepresentation) seems limited to system value types (IntentPerson, PlaceDescriptor); IntentFile is not a _SystemIntentValue, so an image can't ride that rail. • Onscreen awareness (NSUserActivity.appEntityIdentifier, View Annotations) appears to expose only the foreground app's own content — which here is Photos, not me. Question: Is there a supported way for a third‑party app to receive another app's on‑screen image (vs. a contact/place) through Siri/App Intents today? If so, which API carries the pixels — an IntentFile parameter, @UnionValue, IntentValueQuery, something else — and what must the source app do to make it available? Or is asking "do X to this image in <third‑party app>" simply not supported yet outside Shortcuts?
Replies
4
Boosts
1
Views
1.2k
Activity
6d
Siri AI + Schema .system.open
Since iOS 18, I have an OpenIntent to open documents. For Siri AI, I understood that I need to annotate the entity with @AppIntent(schema: .system.open) for Siri AI to be able to open documents. This is only supported starting with iOS 27. I tried duplicating the intent (one for iOS 27, one for the other versions), however, Xcode complains and says that only one OpenIntent is possible per target entity. How are we supposed to: support Siri AI "open" functionality preserve functionality for older iOS versions ? Thank you
Replies
1
Boosts
2
Views
484
Activity
6d
OpenIntent vs .system.open App Schema: Which should be used for opening entities on iOS 27 and later?
I'm trying to understand the intended relationship between OpenIntent and the new .system.open App Intent schema introduced in iOS 27. From the documentation: OpenIntent (available since iOS 16) is described as an intent that opens an associated item. iOS 27 introduces the .system.open schema, which also appears to represent opening an entity or piece of app content. My questions are: For an app that supports iOS 27+, is .system.open intended to replace OpenIntent, or do the two serve different purposes? For apps that support both iOS 26 and iOS 27+, is the recommended approach to have two structs that implement the same opening logic, one with @AppIntent(schema: .system.open) and the other implementing the OpenIntent protocol? Thanks! References: open protocol OpenIntent
Replies
3
Boosts
0
Views
1.6k
Activity
6d
Xcode 27 beta: @AppEntity(schema: .photos.asset) now requires iOS 27 (compiled for iOS 18 in Xcode 26)
Filed as FB23652582. In Xcode 27 beta, this no longer compiles when the deployment target is below iOS 27: @available(iOS 18.0, *) @AppEntity(schema: .photos.asset) struct AssetEntity: IndexedEntity { ... } // error: 'asset' is only available in iOS 27.0 or newer The identical source compiles under Xcode 26. It looks like the @AppEntity(schema:) macro now resolves .photos.asset to a declaration annotated for iOS 27, whereas in Xcode 26 it resolved to the (now-deprecated) iOS 16 declaration. What seems off: the .photos.album entity in the same domain still builds fine at an iOS 18 deployment target — only .asset requires iOS 27. That asymmetry is what makes me think it may be an unintended availability change rather than a deliberate one. Has anyone else hit this? And is this intended — i.e. is .photos.asset now meant to be iOS 27+ only, or should it still be usable from apps that deploy to iOS 18?
Replies
2
Boosts
2
Views
799
Activity
1w
Is there any public way to create a pre-filled note in Notes.app from a third-party iOS app?
I'm building a cross-platform app (.NET MAUI) on ios with a feature that lets users send a block of text to their preferred note-taking app to save for later. This works fine via their documented x-callback-url schemes (e.g. bear://x-callback-url/create?text=...). I'd like to support Apple's own Notes app the same way, but I can't find a documented mechanism to do so. Questions: Is there a URL scheme for Notes.app that a third-party app can use to open it, and if so, does it support passing in content for a new note? Is there any officially supported way — App Intents, or otherwise — to create a new note with pre-filled text in Notes.app from another app? Does the new Notes domain under App Intents (iOS 18+) apply to Apple's own Notes app, or is it purely a schema that third-party note apps can adopt for themselves? If it does apply, is there a way to invoke it directly from another app's UI rather than only via Siri/Shortcuts? If none of the above exists, is routing through the standard share sheet the intended/only supported approach for this use case going forward? Thanks in advance — wanting to make sure I'm not missing a documented mechanism before concluding this isn't possible.
Replies
1
Boosts
0
Views
235
Activity
2w
Is Siri AI unavailable to users or developers in European Union (EU)?
Hello, I'm a EU-based developer. Our app is distributed worldwide. I'd like to clarify the following regarding Siri AI and EU: is Siri AI unavailable to users based in EU, or to apps based in EU. In other words, will my app developed in Europe work with Siri AI for US users? Or the fact that my app is developed in Europe excludes it from compatibility with Siri AI? Kind regards, Bruno
Replies
1
Boosts
0
Views
720
Activity
2w
AppIntent CreateReminder schema doesn't work
My intents and entities show up in Shortcuts, and my tests that use App Intents Framework pass. But I can't for the life of me figure out why Siri won't work. I'm trying phrases like "Add to my list in ". All I ever get from Siri is variations of "I can't add items directly to " or "I can't add items to your lists in ". Does anyone see any issues with the following? ( I've left out some of the AppEnum and Entity types for brevity, but these are the main ones) @AppIntent(schema: .reminders.createReminder) struct AddToListIntent { var title: String var list: ListEntity? var note: AttributedString? var isFlagged: Bool? var images: [IntentFile] var tags: Set<String> var urls: [URL] var dueDate: DateComponents? var recurrence: Calendar.RecurrenceRule? var locationTrigger: LocationTriggerEntity? var section: SectionEntity? func perform() async throws -> some ReturnsValue<ReminderEntity> { let newReminder = ReminderEntity(id: "foo", reminder: .init(name: title)) return .result(value: newReminder) } } struct Reminder { var name: String } @AppEntity(schema: .reminders.reminder) struct ReminderEntity { // MARK: Static static let defaultQuery = ReminderEntityQuery() // MARK: Properties let id: String let reminder: Reminder @ComputedProperty(title: "Title") var title: String { reminder.name } var note: AttributedString? { nil } var tags: Set<String> { Set() } var urls: [URL] { [] } var dueDate: DateComponents? { nil } var recurrence: Calendar.RecurrenceRule? { nil } var isCompleted: Bool { false } var isFlagged: Bool? { nil } var creationDate: Date? { nil } var completionDate: Date? { nil } var list: ListEntity var locationTrigger: LocationTriggerEntity? { nil } var displayRepresentation: DisplayRepresentation { .init(title: "\(title)") } // MARK: Query struct ReminderEntityQuery: EntityQuery, EnumerableEntityQuery { func entities(for identifiers: [ReminderEntity.ID]) async throws -> [ReminderEntity] { identifiers.map { .init(id: $0, reminder: .init(name: "Foo")) } } func allEntities() async throws -> [ReminderEntity] { ["foo", "bar", "baz"].map { ReminderEntity(id: $0, reminder: .init(name: $0)) } } } } @AppEntity(schema: .reminders.list) struct ListEntity: AppEntity, IndexedEntity { let id: String let myName: String var name: String { myName } // 3. Define how this entity is displayed to the user in shortcuts/Siri var displayRepresentation: DisplayRepresentation { DisplayRepresentation(title: "\(myName)") } @Property var type: MyListType // 4. Provide a query so the system can resolve specific lists static var defaultQuery = ListEntityQuery() }
Replies
1
Boosts
0
Views
162
Activity
2w
App Shortcuts Action button default parameter
Hello, I have a question about App Intents and the Action button on iPhone. I have an App Intent that opens the app and navigates to a specific entity, conforming to OpenIntent with a single AppEntity parameter. The entity conforms to EnumerableEntityQuery, and the intent is registered as an App Shortcut via the AppShortcutsProvider. When assigning this shortcut to the Action button in Settings, the system doesn’t prompt the user to select a default entity upfront. Instead, it prompts on every activation, creating friction. In contrast, shortcuts like “Open Note…” and other third-party ones prompt the user for a note to open when setting up the Action button, and its title also includes three dots, indicating a pre-configurable parameter. My shortcut’s title shows no dots. What’s required to make an App Shortcut prompt for a default parameter during Action button setup? Sincerely, Holger
Replies
4
Boosts
0
Views
1.2k
Activity
2w
PSA: `.photos.editAsset` fails unless the entity type is named `AssetEntity` on iOS 27
We found an apparent iOS 27 WorkflowKit bug when implementing: @AppIntent(schema: .photos.editAsset) with an entity conforming to: @AppEntity(schema: .photos.asset) Despite Apple’s general guidance that schema entity types may be renamed, Siri only worked when our entity’s Swift type was named exactly AssetEntity. Controlled on-device results: AssetEntity — works PhotoAssetEntity — fails FooAssetEntity — fails For the failing names, neither the entity query nor perform() was reached. WorkflowKit logged: Failed to retrieve entity metadata Error Domain=WFActionErrorDomain Code=6 Siri responded: Unable to retrieve the data information to process. The generated App Intents metadata was internally consistent, and the issue persisted across clean installs and a device restart. Current workaround: name the .photos.asset entity type exactly AssetEntity. Tested with Xcode 27.0 beta (27A5252f) and iPadOS 27.0 (24A5423a). Filed with Apple as FB24604095 for anyone from Apple investigating this behavior.
Replies
0
Boosts
2
Views
142
Activity
2w
Confusing relationship between attributeSet, defaultAttributeSet, and displayRepresentation
I’m trying to understand the intended relationship between IndexedEntity.attributeSet, defaultAttributeSet, and displayRepresentation. For example: struct TrailEntity: IndexedEntity { var displayRepresentation: DisplayRepresentation { DisplayRepresentation( title: "(trail.name)", subtitle: "(trail.location)" ) } var attributeSet: CSSearchableItemAttributeSet { let attributes = CSSearchableItemAttributeSet() attributes.keywords = trail.keywords return attributes } } Should attributeSet instead be initialized with defaultAttributeSet and then have the additional attributes assigned to it? var attributeSet: CSSearchableItemAttributeSet { let attributes = defaultAttributeSet attributes.keywords = trail.keywords return attributes } The documentation says defaultAttributeSet contains values derived from displayRepresentation, but it also describes precedence between displayRepresentation and attributeSet, which suggests Spotlight reads them separately during indexing. So what is the intended pattern? Does overriding attributeSet require including defaultAttributeSet to preserve title/subtitle/image metadata, or is attributeSet only meant for additional Core Spotlight metadata? If the latter, what is the intended use case for overriding or directly using defaultAttributeSet?
Replies
1
Boosts
0
Views
168
Activity
3w
AppShortcutsProvider not detected by the Shortcuts app – app built entirely with Swift Playgrounds + TestFlight
Context I built an app entirely using Swift Playgrounds on iPad (no access to a Mac / Xcode). The app is distributed via TestFlight and installed on an iPhone. Problem I implemented an AppShortcutsProvider with simple AppShortcut entries (code below), but no shortcuts show up in the Shortcuts app, in the list of apps with shortcuts, or via Siri. What I've already tried without success: Full restart of the iPhone Deleting the app's data Fully uninstalling and reinstalling the app A new TestFlight build (with incremented build number) after adding the code Confirming the phrases correctly include (.applicationName) as required Question Is the Extract AppIntentsMetadata build step (which generates the metadata.appintents file) actually executed when compiling/submitting via Swift Playgrounds on iPad, or is this a known limitation of the tool that would prevent App Shortcuts from being indexed by Shortcuts/Siri? Environment Swift Playgrounds version: [check in the app under Settings > General > About] iOS version on test iPhone: [fill in] Project deployment target: [fill in if known, otherwise note that you have no way to check this without Xcode] Provider code: import SwiftUI import AppIntents // ============================================================ // MARK: - TEST INTENT // ============================================================ struct TestExpenseIntent: AppIntent { static let title: LocalizedStringResource = "Test dépense" static let description = IntentDescription( "Teste l'intégration de l'application avec Raccourcis." ) static let isDiscoverable = true func perform() async throws -> some IntentResult { return .result(dialog: "Ça fonctionne !") } } // ============================================================ // MARK: - ADD EXPENSE INTENT // ============================================================ struct AddApplePayExpenseIntent: AppIntent { static let title: LocalizedStringResource = "Ajouter une dépense" static let description = IntentDescription( "Ajoute une dépense à un Tricount." ) static let isDiscoverable = true static let openAppWhenRun = false @Parameter(title: "Montant") var amount: Double? @Parameter(title: "Marchand") var merchant: String? func perform() async throws -> some IntentResult { let valAmount = amount ?? 0.0 let valMerchant = merchant ?? "Inconnu" print("Montant :", valAmount) print("Marchand :", valMerchant) return .result( dialog: "Dépense de \(valAmount) € chez \(valMerchant)." ) } } // ============================================================ // MARK: - SHORTCUTS // ============================================================ struct MyAppShortcuts: AppShortcutsProvider { static var shortcutTileColor: ShortcutTileColor = .blue static let appShortcuts: [AppShortcut] = [ AppShortcut( intent: TestExpenseIntent(), phrases: [ "Tester \(.applicationName)" ], shortTitle: "Test dépense", systemImageName: "plus.circle" ), AppShortcut( intent: AddApplePayExpenseIntent(), phrases: [ "Ajouter une dépense dans \(.applicationName)", "Ajouter \(\.$amount) dans \(.applicationName)" ], shortTitle: "Ajouter une dépense", systemImageName: "plus.circle" ) ] }
Replies
1
Boosts
0
Views
260
Activity
3w
Unable to use new Siri in macOS27 beta - showing connection error.
When trying to access new Siri in macOS 27 beta 7 it always showing 'I’m having trouble with the connection. Please try again later.'. Tried changing the language multiple times and restarted the mac as well. But nothing resolved the issue. Has anybody faced this issue. is this related to network settings ?.
Replies
0
Boosts
0
Views
393
Activity
3w
Disable Ask Siri
How do I disable the "Ask Siri" button in the SwiftUl context menu in macOS?
Replies
1
Boosts
1
Views
415
Activity
3w
Adding an OptionsCollection to an existing AppShortcut hides all other parameterless App Shortcuts from the Shortcuts app UI
Hi all, I’m seeing what looks like a bug with AppShortcutParameterPresentation and the Shortcuts app. Any time I provide an OptionsCollection to a shortcut so I can give it a nice category name and symbol in Shortcuts, it hides all other existing app shortcuts that my app has from the UI. I have created a sample that illustrates the problem. My app provides two App Shortcuts: A simple shortcut with no parameters. A shortcut with two parameters. Its Destination parameter uses AppShortcutParameterPresentation to generate “Home” and “Office” options in a separate section. When the second shortcut is present, the first parameterless shortcut disappears from the Shortcuts app. If I comment out the shortcut containing parameterPresentation, the parameterless shortcut appears again. Before commenting out: After commenting out the second shortcut: Here's the code: import AppIntents struct ParameterlessIntent: AppIntent { static let title: LocalizedStringResource = "Parameterless Intent" static let description = IntentDescription("Runs without asking for any parameters.") func perform() async throws -> some IntentResult { .result() } } struct ParameterizedIntent: AppIntent { static let title: LocalizedStringResource = "Parameterized Intent" static let description = IntentDescription("Runs with a destination and a copy count.") // The same provider is used by this parameter and by ParameterPresentation below. @Parameter( title: "Destination", optionsProvider: DestinationOptionsProvider() ) var destination: String @Parameter(title: "Copy Count", default: 1) var copyCount: Int static var parameterSummary: some ParameterSummary { Summary("Send \(\.$copyCount) copies to \(\.$destination)") } func perform() async throws -> some IntentResult { .result() } } nonisolated struct DestinationOptionsProvider: DynamicOptionsProvider { func results() async throws -> [String] { // Each generated App Shortcut option is a value for the Destination parameter. ["Home", "Office"] } } struct BugReproductionShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { // This parameterless shortcut should always appear in the Shortcuts app. AppShortcut( intent: ParameterlessIntent(), phrases: [ "Run the parameterless shortcut with \(.applicationName)" ], shortTitle: "Do I exist?", systemImageName: "1.circle" ) #warning("The presence of this shortcut causes the top one no longer appear in Shortcuts.app") AppShortcut( intent: ParameterizedIntent(), phrases: [ "Run the parameterized shortcut with \(.applicationName)" ], shortTitle: "Parameterized Shortcut", systemImageName: "2.circle", parameterPresentation: ParameterPresentation( for: \.$destination, summary: Summary("Send to \(\.$destination)") ) { // This title and symbol create a separate section in Shortcuts. OptionsCollection( DestinationOptionsProvider(), title: "Destination Shortcuts", systemImageName: "mappin.and.ellipse" ) } ) } } This code and reproduction is as of Xcode 27 Beta 6 and happens on older versions as well. Is there a known limitation with this or is this somehow expected behavior? If so, how can I mitigate this issue and provide a nice title for another shortcut, while keeping the old parameterless shortcuts present? Thanks!
Replies
1
Boosts
0
Views
446
Activity
3w
UIKit AppIntentSceneDelegate: connectionOptions.appIntent is nil on cold launch (iOS Beta) -
Hi everyone, I am currently implementing the new Search API in a UIKit app using @AppIntent(schema: .system.search), ShowInAppSearchResultsIntent, and UISceneAppIntent. While testing on the iOS beta, I’ve hit a significant lifecycle disparity between how UIKit and SwiftUI apps process system intents during a process-cold launch. According to the documentation for UIScene.ConnectionOptions.appIntent, this property should contain the intent that triggered the scene creation. However, in a UIKit app with a single-window scene lifecycle, this isn't happening consistently. Here is the behaviour breakdown I am seeing: Cold Launch (Siri/Search → App completely closed) SwiftUI App: Works as documented. The intent is present in connection options. scene(_:willPerformAppIntent:) is not called. UIKit App (with AppIntentSceneDelegate): The connectionOptions.appIntent property is completely nil inside scene(:willConnectTo:options:). Instead, the intent is delivered late via scene(:willPerformAppIntent:) right after scene connection completes. Warm Launch (Siri/Search → App already suspended in memory) Both SwiftUI and UIKit: Behave identically. The intent is delivered directly to scene(_:willPerformAppIntent:). The Problem Because of this gap, there is no unified way to handle a process-cold launch under UIKit. There is no LaunchOptionsKey available to identify that an App Intent initiated the launch, and the missing connection option forces us to bifurcate our routing logic. I have already filed a bug report via Feedback Assistant: FB24513291 and attached a minimal reproducible sample project. Has anyone else run into this specific AppIntentSceneDelegate race condition on the iOS beta? If so, what architecture or unified pattern are you using to normalize the lifecycle routing between cold and warm launches in UIKit? Any insights or clean workaround ideas would be highly appreciated!
Replies
0
Boosts
0
Views
408
Activity
3w
AppShortcutsProvider not detected by the Shortcuts app – app built entirely with Swift Playgrounds
Context I built an app entirely using Swift Playgrounds on iPad (no access to a Mac / Xcode). The app is distributed via TestFlight and installed on an iPhone. Problem I implemented an AppShortcutsProvider with simple AppShortcut entries (code below), but no shortcuts show up in the Shortcuts app, in the list of apps with shortcuts, or via Siri. What I've already tried without success: Full restart of the iPhone Deleting the app's data Fully uninstalling and reinstalling the app A new TestFlight build (with incremented build number) after adding the code Confirming the phrases correctly include (.applicationName) as required Question Is the Extract AppIntentsMetadata build step (which generates the metadata.appintents file) actually executed when compiling/submitting via Swift Playgrounds on iPad, or is this a known limitation of the tool that would prevent App Shortcuts from being indexed by Shortcuts/Siri? Provider code: import SwiftUI import AppIntents // ============================================================ // MARK: - TEST INTENT // ============================================================ struct TestExpenseIntent: AppIntent { static let title: LocalizedStringResource = "Test dépense" static let description = IntentDescription( "Teste l'intégration de l'application avec Raccourcis." ) static let isDiscoverable = true func perform() async throws -> some IntentResult { return .result(dialog: "Ça fonctionne !") } } // ============================================================ // MARK: - ADD EXPENSE INTENT // ============================================================ struct AddApplePayExpenseIntent: AppIntent { static let title: LocalizedStringResource = "Ajouter une dépense" static let description = IntentDescription( "Ajoute une dépense à un Tricount." ) static let isDiscoverable = true static let openAppWhenRun = false @Parameter(title: "Montant") var amount: Double? @Parameter(title: "Marchand") var merchant: String? func perform() async throws -> some IntentResult { let valAmount = amount ?? 0.0 let valMerchant = merchant ?? "Inconnu" print("Montant :", valAmount) print("Marchand :", valMerchant) return .result( dialog: "Dépense de \(valAmount) € chez \(valMerchant)." ) } } // ============================================================ // MARK: - SHORTCUTS // ============================================================ struct MyAppShortcuts: AppShortcutsProvider { static var shortcutTileColor: ShortcutTileColor = .blue static let appShortcuts: [AppShortcut] = [ AppShortcut( intent: TestExpenseIntent(), phrases: [ "Tester (.applicationName)" ], shortTitle: "Test dépense", systemImageName: "plus.circle" ), AppShortcut( intent: AddApplePayExpenseIntent(), phrases: [ "Ajouter une dépense dans (.applicationName)", "Ajouter (.$amount) dans (.applicationName)" ], shortTitle: "Ajouter une dépense", systemImageName: "plus.circle" ) ] }
Replies
0
Boosts
0
Views
241
Activity
3w
Spotlight on finds title attribute (OS27 b3)
Hi, it seems that something in OS27b3 changed regarding Core Spotlight: Whatever I try, Siri and Spotlight only seem to find the text inside the title or displayName attribute. But attributes like textContent or contentDescription or keywords seem to be ignored. Those attributes are still found, when I do a manual search using CSUserQuery or using the AppEntityDefinition.spotlightQuery(_:) in App Intent Testing. I have already filed a Feedback – but wonder whether anyone else is having this issue? FB23635795 Thanks, Friedrich
Replies
4
Boosts
0
Views
766
Activity
3w
Are `NSTableViewAppIntentsDataSource` data source methods expected to be called?
I've looked and looked and can't seem to find anything obviously wrong, so I'll ask here. Are NSTableViewAppIntentsDataSource protocol methods expected to be called? Have others had success with this? I've got an extremely trivial NSViewController subclass that conforms to NSTableViewDataSource, NSTableViewDelegate, NSTableViewAppIntentsDataSource. Things I've verified: The NSTableView is setup in a storyboard and the delegate and data source are connected to the view controller. In viewDidLoad while attached to the debugger I see this works. The table view includes a single row and appears populated when running the app. There seems to be no way to assign the appIntentsDataSource view controller in the storyboard, so that's assigned in code in viewDidLoad for the view controller. I can confirm it's correctly set in the data source methods for the table view. I have an AppEntity conforming type and AppIntentsPackage conforming type in the project. I can look at the actionsdata in the built product to confirm the entity is registered. Here's the entirety of the view controller: class ViewController: NSViewController, NSTableViewDataSource, NSTableViewDelegate, NSTableViewAppIntentsDataSource { @IBOutlet var tableView: NSTableView! func numberOfRows(in tableView: NSTableView) -> Int { print("numberOfRows(in:)") return 1 } dynamic public func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? { print("tableView(_:objectValueFor:row:)") return NSObject() } override func viewDidLoad() { super.viewDidLoad() tableView.appIntentsDataSource = self } override var representedObject: Any? { didSet { // Update the view, if already loaded. } } dynamic public func tableView(_ tableView: NSTableView, appEntityIdentifierFor row: Int) -> EntityIdentifier? { print("ViewController.tableView(_:appEntityIdentifierFor:)") return EntityIdentifier(for: MyFancyEntity.self, identifier: "1234") } } Unfortunately, while attached with a debugger, ViewController.tableView(_:appEntityIdentifierFor:) just never seems to be called.
Replies
0
Boosts
0
Views
319
Activity
Aug ’26
Group AppIntents’ Searchable DynamicOptionsProvider in Sections
I’m trying to group my EntityPropertyQuery selection into sections as well as making it searchable. I know that the EntityStringQuery is used to perform the text search via entities(matching string: String). That works well enough and results in this modal: Though, when I’m using a DynamicOptionsProvider to section my EntityPropertyQuery, it doesn’t allow for searching anymore and simply opens the sectioned list in a menu like so: How can I combine both? I’ve seen it in other apps, but can’t figure out why my code doesn’t allow to section the results and make it searchable? Any ideas? My code (simplified) struct MyIntent: AppIntent { @Parameter(title: "Meter"), optionsProvider: MyOptionsProvider()) var meter: MyIntentEntity? // … struct MyOptionsProvider: DynamicOptionsProvider { func results() async throws -> ItemCollection<MyIntentEntity> { // Get All Data let allData = try IntentsDataHandler.shared.getEntities() // Create Arrays for Sections let fooEntities = allData.filter { $0.type == .foo } let barEntities = allData.filter { $0.type == .bar } return ItemCollection(sections: [ ItemSection("Foo", items: fooEntities), ItemSection("Bar", items: barEntities) ]) } } struct MeterIntentQuery: EntityStringQuery { // entities(for identifiers: [UUID]) and suggestedEntities() functions func entities(matching string: String) async throws -> [MyIntentEntity] { // Fetch All Data let allData = try IntentsDataHandler.shared.getEntities() // Filter Data by String let matchingData = allData.filter { data in return data.title.localizedCaseInsensitiveContains(string)) } return matchingData } }
Replies
2
Boosts
2
Views
1.5k
Activity
Aug ’26
AppIntent ignores registered dependencies when awaited
App intent has a perform method that is async and can throw an error, but I can't find a way to actually await the result and catch the error if needed. If I convert this working but non-waiting, non-catching code: Button("Go", intent: MyIntent()) to this (so I can control awaiting and error handling): Button("Go") { Task { do { try await MyIntent().perform() // 👈 } catch { print(error) } } } It crashes: AppDependency with key "foo" of type Bar.Type was not initialized prior to access. Dependency values can only be accessed inside of the intent perform flow and within types conforming to _SupportsAppDependencies unless the value of the dependency is manually set prior to access. Although it is invalid since the first version is working like a charm and dependencies are registered in the @main App init method and it is in the perform flow. So how can we await the result of the AppIntent and handle the errors if needed in the app? Should I re-invent the Dependency mechanism?
Replies
1
Boosts
0
Views
1k
Activity
Aug ’26