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
Sort by:

Post

Replies

Boosts

Views

Activity

Debugging updateAppShortcutParameters not adding shortcuts to Shortcuts App
So I'm developing an ios application which should be showing shortcuts, but its not. I'm not sure how to debug why the functionality isnt working. Believe I'm correctly calling AppShortcutsProvider's updateAppShortcutParameters, but I dont see any errors in the console showing me a problem. And in fact, I made a simplified just swift version that works before I tried to integrate it into a more complex project. But now I'm at a loss as to what is going wrong or what debug tools I can use to figure it out. Any help would be appreciated. When building my project I see: 025-08-18 14:07:49.371 appintentsmetadataprocessor[57506:35387547] Starting appintentsmetadataprocessor export 2025-08-18 14:07:49.414 appintentsmetadataprocessor[57506:35387547] Writing Metadata.appintents 2025-08-18 14:07:49.414 appintentsmetadataprocessor[57506:35387547] Metadata root: /Users/jpetersen/Library/Developer/Xcode/DerivedData/Unity-iPhone-dtnhxevagfkzsjdavesziaqrwisr/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/Metadata.appintents AppIntentsSSUTraining (in target 'UnityFramework' from project 'Unity-iPhone') cd /Users/jpetersen/no_doc_repos/payments_ios_investigation/SpotlightSearch/client/Build /Applications/Xcode_16.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/appintentsnltrainingprocessor --infoplist-path /Users/jpetersen/Library/Developer/Xcode/DerivedData/Unity-iPhone-dtnhxevagfkzsjdavesziaqrwisr/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/Info.plist --temp-dir-path /Users/jpetersen/Library/Developer/Xcode/DerivedData/Unity-iPhone-dtnhxevagfkzsjdavesziaqrwisr/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/ssu --bundle-id com.unity3d.framework --product-path /Users/jpetersen/Library/Developer/Xcode/DerivedData/Unity-iPhone-dtnhxevagfkzsjdavesziaqrwisr/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework --extracted-metadata-path /Users/jpetersen/Library/Developer/Xcode/DerivedData/Unity-iPhone-dtnhxevagfkzsjdavesziaqrwisr/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/Metadata.appintents --archive-ssu-assets 2025-08-18 14:07:49.436 appintentsnltrainingprocessor[57507:35387550] Parsing options for appintentsnltrainingprocessor 2025-08-18 14:07:49.437 appintentsnltrainingprocessor[57507:35387550] Starting AppIntents SSU YAML Generation 2025-08-18 14:07:49.444 appintentsnltrainingprocessor[57507:35387550] Training 'Start ${+applicationName}' for English 2025-08-18 14:07:49.444 appintentsnltrainingprocessor[57507:35387550] Training 'Play ${ShortcutEntity}|Play ${ShortcutEntity} on ${+applicationName}' for English 2025-08-18 14:07:49.444 appintentsnltrainingprocessor[57507:35387550] Training Negative Phrases '' for English 2025-08-18 14:07:49.444 appintentsnltrainingprocessor[57507:35387550] Application name 'UnityFramework' for English 2025-08-18 14:07:49.449 appintentsnltrainingprocessor[57507:35387550] Generated AppIntents SSU YAML files in file:///Users/jpetersen/Library/Developer/Xcode/DerivedData/Unity-iPhone-dtnhxevagfkzsjdavesziaqrwisr/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/ssu/ 2025-08-18 14:07:49.449 appintentsnltrainingprocessor[57507:35387550] Copied AppIntents SSU YAML files to file:///Users/jpetersen/Library/Developer/Xcode/DerivedData/Unity-iPhone-dtnhxevagfkzsjdavesziaqrwisr/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/Metadata.appintents/ So I think it should be making the required app intent data :shrug:
2
0
49
36m
Transaction Shortcuts + AppIntent is flaky occasionally
Hello, I made myself an app to track my expenses. The most important event is when I make a purchase via apple wallet. What happens is sometimes the values from Merchant and Amount are; Merchant = " " Amount = 0.0 Has anyone experienced this, is there something I can do about it ? I was thinking that sometimes maybe speed connection and service is something that might make an impact Does anyone here know something about the topic ?
1
0
109
2d
Siri complains AppIntent is not registered
My question is similar to https://developer.apple.com/forums/thread/757298?answerId=791343022#791343022 but the solution from there did not help me. My app sends messages. I need it to do so when a user says to Siri: "Send message with ". When a user says so, Siri shows "Open button and says " hasn't added support for that with Siri". The code is pretty short and must work, but it doesn't. Could you please help and explain how to add the support mentioned above? How else I can use AppIntent and register the app as one capable to send messages when asked by Siri? import AppIntents @main struct MyAppNameApp: App { var body: some Scene { WindowGroup { ContentView() } } init() { MyAppNameShortcuts.updateAppShortcutParameters() Task { await MyAppNameShortcuts.updateAppShortcutParameters() } } } struct SendMessageWithMyAppName: AppIntent { static var title: LocalizedStringResource = "Send message" static let description = IntentDescription( "Dictate a message and have MyAppName print it to the Xcode console.") @Parameter(title: "Message", requestValueDialog: "What should I send?") var content: String static var openAppWhenRun = false func perform() async throws -> some IntentResult { print("MyAppName message: \(content)") await MainActor.run { NotificationCenter.default.post(name: .newMessageReceived, object: content) } return .result(dialog: "Message sent: \(content)") } } struct MyAppNameShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: SendMessageWithMyAppName(), phrases: [ "Send message with \(.applicationName)" ], shortTitle: "Send Message", systemImageName: "message" ) } }
1
0
43
2w
AppShortcuts
I currently use AppShortcutsProvider successfully to register AppShortcut items that appear in the Shortcuts app and in Spotlight on iOS 18 (built with Xcode 16.4). However, I'm unable to set a branded image asset (SVG or PNG) as the tile icon — only SF Symbols are allowed via systemImageName: String, and specifying an asset name results in a blank icon in the UI. Interestingly, other apps (e.g. Notes, Talabat, Photos) seem to display a custom image as the shortcut’s icon in Shortcuts, despite current documentation stating otherwise. I'm kindly requesting Apple formalize and support this capability.
1
0
85
2w
About AppShortcuts limit
I developed a shortcut feature for my app using the AppIntents framework, which can display a maximum of 10 shortcuts in the Shortcuts app. However, I've noticed that apps like Tesla and Porsche have a significantly larger number of shortcuts, far exceeding 10. After searching online, I found that they might be using Intent Extensions and the SiriKit framework. I customized an Intent through SiriKit, checked the option for "Intent is user-configurable in the Shortcuts app" and "Add to Siri." I can find this shortcut when I search for it, but it does not appear on the homepage or under the app category. Is there any way to resolve this?
4
0
100
2w
Siri not prompting to enable for AppIntent
We're trying to add an AppIntent to our very complex and large app that works with Siri. What we've found through numerous different configuration attempts is that when the Siri toggle is turned off on in the Shortcuts app for our app, when we speak our phrase to Siri we get this prompt: " hasn't added support for that with Siri." with an "Open " button. When we speak the phrase while the app is open, we get the prompt that says "Turn on "" shortcuts with Siri?" with a "Turn On" button. When the Siri toggle is turned on for our app in the Shortcuts app, all of our phrases work as expected. Is there some kind of configuration we're missing? There doesn't seem to be a lot of documentation. We've tried to match an example app's approach (AcceleratingAppInteractionsWithAppIntents) to no avail. Our app intents live in an xcframework if that makes a difference, but we've also tried moving it out of xcframework without success. This is a blocker to us shipping this feature. Thanks!
2
0
120
4w
AttributedString in App Intents
In this WWDC25 session, it is explictely mentioned that apps should support AttributedString for text parameters to their App Intents. However, I have not gotten this to work. Whenever I pass rich text (either generated by the new "Use Model" intent or generated manually for example using "Make Rich Text from Markdown"), my Intent gets an AttributedString with the correct characters, but with all attributes stripped (so in effect just plain text). struct TestIntent: AppIntent { static var title = LocalizedStringResource(stringLiteral: "Test Intent") static var description = IntentDescription("Tests Attributed Strings in Intent Parameters.") @Parameter var text: AttributedString func perform() async throws -> some IntentResult & ReturnsValue<AttributedString> { return .result(value: text) } } Is there anything else I am missing?
0
0
160
Jul ’25
Array of AppEnum in a Parameter will always be empty
Consider the following in an AppIntent: struct TestIntent: AppIntent { static let title: LocalizedStringResource = "Test Intent" static var parameterSummary: some ParameterSummary { Summary("Test") { \.$options } } enum Option: Int, CaseIterable, AppEnum { case one case two case three case four case five case six static let typeDisplayRepresentation: TypeDisplayRepresentation = TypeDisplayRepresentation( name: "Options" ) static let caseDisplayRepresentations: [Option: DisplayRepresentation] = [ .one: DisplayRepresentation(title: "One"), .two: DisplayRepresentation(title: "Two"), .three: DisplayRepresentation(title: "Three"), .four: DisplayRepresentation(title: "Four"), .five: DisplayRepresentation(title: "Five"), .six: DisplayRepresentation(title: "Six"), ] } @Parameter(title: "Options", default: []) var options: [Option] @MainActor func perform() async throws -> some IntentResult { print(options) return .result() } } In Shortcuts, this will turn into a dropdown where you can check multiple Option values. However, when perform() is called, options will be an empty array regardless of what the user selects. This is observed on both iOS 18.5 and macOS 15.5. However, on iOS 26.0 beta and macOS 26.0 beta, the issue seems to be resolved and options contains all the checked options. However, we do back deploy to current/previous iOS/macOS versions. How can we provide a multiple choice selection of fixed values on these older versions?
3
0
125
2w
AudioPlaybackIntent usage requesting a screen unlock
Hello, I have an AppIntent that uses the AudioPlaybackIntent to trigger my app to open and initiate an AVPlayer that plays back a media stream I control. When the phone is unlocked, everything works as I expect. The app opens and plays the audio. However, when the phone is locked, any attempt to invoke the intent causes a "Request Code" dialog to be displayed. This seems counter to what I would expect with the AudioPlaybackIntent usage. Am I able to accomplish what I'm after here with AppIntents? Does the fact that I'm using openAppWhenRun require me to have the phone unlocked somehow? import AppIntents import Foundation struct PlayStationAppIntent: AudioPlaybackIntent { static var title: LocalizedStringResource = "Play radio station" static var description: IntentDescription = .init("Play radio station") static var notification: Notification.Name = .init("playStation") static var openAppWhenRun: Bool = true init() {} func perform() async throws -> some IntentResult { AudioPlayerService.shared.play() return .result() } }
0
0
84
Jul ’25
SwiftUI App Intent throws error when using requestDisambiguation with @Parameter property wrapper
I'm implementing an App Intent for my iOS app that helps users plan trip activities. It only works when run as a shortcut but not using voice through Siri. There are 2 issues: The ShortcutsTripEntity will only accept a voice input for a specific trip but not others. I'm stuck with a throwing error when trying to use requestDisambiguation() on the activity day @Parameter property. How do I rectify these issues. This is blocking me from completing a critical feature that lets users quickly plan activities through Siri and Shortcuts. Expected behavior for trip input: The intent should make Siri accept the spoken trip input from any of the options. Actual behavior for trip input: Siri only accepts the same trip when spoken but accepts any when selected by click/touch. Expected behavior for day input: Siri should accept the spoken selected option. Actual behavior for day input: Siri only accepts an input by click/touch but yet throws an error at runtime I'm happy to provide more code. But here's the relevant code: struct PlanActivityTestIntent: AppIntent { @Parameter(title: "Activity Day") var activityDay: ShortcutsItineraryDayEntity @Parameter( title: "Trip", description: "The trip to plan an activity for", default: ShortcutsTripEntity(id: UUID().uuidString, title: "Untitled trip"), requestValueDialog: "Which trip would you like to add an activity to?" ) var tripEntity: ShortcutsTripEntity @Parameter(title: "Activity Title", description: "The title of the activity", requestValueDialog: "What do you want to do or see?") var title: String @Parameter(title: "Activity Day", description: "Activity Day", default: ShortcutsItineraryDayEntity(itineraryDay: .init(itineraryId: UUID(), date: .now), timeZoneIdentifier: "UTC")) var activityDay: ShortcutsItineraryDayEntity func perform() async throws -> some ProvidesDialog { // ...other code... let tripsStore = TripsStore() // load trips and map them to entities try? await tripsStore.getTrips() let tripsAsEntities = tripsStore.trips.map { trip in let id = trip.id ?? UUID() let title = trip.title return ShortcutsTripEntity(id: id.uuidString, title: title, trip: trip) } // Ask user to select a trip. This line would doesn't accept a voice // answer. Why? let selectedTrip = try await $tripEntity.requestDisambiguation( among: tripsAsEntities, dialog: .init( full: "Which of the \(tripsAsEntities.count) trip would you like to add an activity to?", supporting: "Select a trip", systemImageName: "safari.fill" ) ) // This line throws an error let selectedDay = try await $activityDay.requestDisambiguation( among: daysAsEntities, dialog:"Which day would you like to plan an activity for?" ) } } Here are some related images that might help:
0
0
97
Jul ’25
Unable to find AppShortcutProvider
Hello, I'm evaluating if it's worth to expose shortcuts from our app, it seems to be working fine on my machine - Apple Silicon, latest Tahoe beta, Xcode 26 beta. But if I compile the same code on our intel build agents which are running latest macOS 15 and Xcode 26 beta, once I install the bundle to /Applications on Tahoe I don't see any shortcuts. Only other difference is that CI build is signed with distribution DeveloperID certificate - I re-signed the build with my dev certificate and it has no effect. I found out that linkd is somehow involved in the discovery process and most relevant logs look like this: default (...) linkd Registry com.**** is not link enabled com.apple.appintents debug (...) linkd ApplicationService Created AppShortcutClient with bundleId: com.**** com.apple.appintents error (...) linkd AppService Unable to find AppShortcutProvider for com.**** com.apple.appintents Could you please advice where to look for the problem?
0
0
97
Jul ’25
How do I maintain different navigation selections on a per-scene basis in SwiftUI?
I’ll preface this by saying I’ve submitted a DTS ticket with essentially this exact text, but I thought I’d also post about it here to get some additional input. Apple engineers: the case ID is 14698374, for your reference. I have an observable class, called NavigationModel, that powers navigation in my SwiftUI app. It has one important property, navigationSelection, that stores the currently selected view. This property is passed to a List in the sidebar column of a NavigationSplitView with two columns. The list has NavigationLinks that accept that selection as a value parameter. When a NavigationLink is tapped, the detail column shows the appropriate detail view per the navigationSelection property’s current value via a switch statement. (This navigationSelection stores an enum value.) This setup allows for complete programmatic navigation as that selection is effectively global. From anywhere in the app — any button, command, or app intent — the selection can be modified since the NavigationModel class uses the @Observable Swift macro. In the app’s root file, an instance of the NavigationModel is created, added as an app intent dependency, and assigned (might be the wrong verb here, but you get it) to ContentView, which houses the NavigationSplitView code. The problem lies when more than one window is opened. Because this is all just one instance of NavigationModel — initialized in the app’s root file — the navigation selection is shared across windows. That is, there is no way for one window to show a view and another to show another view — they’re bound to the same instance of NavigationModel. Again, this was done so that app intents and menu bar commands can modify the navigation selection, but this causes unintended behavior. I checked Apple’s sample projects, namely the “Accelerating app interactions with App Intents” (https://developer.apple.com/documentation/appintents/acceleratingappinteractionswithappintents) and “Adopting App Intents to support system experiences” (https://developer.apple.com/documentation/appintents/adopting-app-intents-to-support-system-experiences) projects, to see how Apple recommends handling this case. Both of these projects have intents to display a view by modifying the navigation selection. They also have the same unintended behavior I’m experiencing in my app. If two windows are open, they share the navigation selection. I feel pretty stupid asking for help with this, but I’ve tried a lot to get it to work the way I want it to. My first instinct was to create a new instance of NavigationModel for each window, and that’s about 90% of the way there, but app intents fail when there are no open windows because there are no instances of NavigationModel to modify. I also tried playing with FocusedValue and SceneStorage, but those solutions also didn’t play well with app intents and added too much convoluted code for what should be a simple issue. In total, what I want is: A window/scene-specific navigation selection property that works across TabViews and NavigationSplitViews A way to reliably modify that property’s value across the app for the currently focused window A way to set a value as a default, so when the app launches with a window, it automatically selects a value in the detail column The navigation selection to reset across app and window launches, restoring the default selection Does anyone know how to do this? I’ve scoured the internet, but again, no dice. Usually Apple’s sample projects are great with this sort of thing, but all of their projects that have scene-specific navigation selection with NavigationSplitView don’t have app intents. 🤷‍♂️ If anyone needs additional code samples, I’d be happy to provide them, but it’s basically a close copy of Apple’s own sample code found in those two links.
0
0
73
Jul ’25
Trouble implementing search via Siri
Hi, we're having trouble implementing search through Siri voice commands. We already did it successfully for audio playback using INPlayMediaIntentHandling. For search, none of the available ways works. Both INSearchForMediaIntentHandling and ShowInAppSearchResultsIntent never open the App in the first place. We tried various commands, but e.g. "Search for " sometimes opens the Apple Music app and sometimes shows a Google search widget. Our app is never taken into consideration for providing any results. We implemented all steps mentioned in WWDC videos and documentation (e.g. https://developer.apple.com/documentation/appintents/making-in-app-search-actions-available-to-siri-and-apple-intelligence), but nothing seems to work. We're mainly testing on iOS 18 currently. Any idea why this is not working?
0
0
41
Jul ’25
Siri Intent: 'Siri, count for '
Hi, I’m developing an app, which just like Clock App, uses multiple counters. I want to speak Siri commands, such as “Siri, count for one hour”. ‘count’ is the alternative app name. My AppIntent has a parameter, and Siri understands if I say “Siri, count” and asks for duration in a separate step. It runs fine, but I can’t figure out how to run the command with the duration specified upfront, without any subsequent questions from Siri. Clock App has this functionality, so it can be done. //title //perform() @Parameter(title: "Duration") var minutes: Measurement<UnitDuration> } I have a struct ShortcutsProvider: AppShortcutsProvider, phrases accept only parameters of type AppEnum or AppEntity.
1
0
74
Jul ’25
App Intents not working with Siri
This implementation works very well for spotlight and App Shortcuts, but for voice commands by Siri, they don't work. AppShortcutsProvider import AppIntents struct CustomerAppIntentProvider: AppShortcutsProvider { @AppShortcutsBuilder static var appShortcuts: [AppShortcut] { AppShortcut( intent: StoresAppIntent(), phrases: ["Mostre as lojas do (.applicationName)"], shortTitle: LocalizedStringResource("Lojas"), systemImageName: "storefront" ) } } Ex. do AppIntent import AppIntents import Foundation import Loyalty import ResourceKit struct StoresAppIntent: AppIntent { static var title: LocalizedStringResource = "Mostrar as lojas" static var description: IntentDescription? = "Este atalho mostra as lojas disponiveis no app" static var openAppWhenRun: Bool = true static var isDiscoverable: Bool = true @MainActor func perform() async throws -&gt; some IntentResult { if let url = URL(string: “app://path") { UIApplication.shared.open(url, options: [:], completionHandler: { (success) in if success { print("Opened \(url)") } else { print("Failed to open \(url)") } }) } return .result() } } Basically that's what I did Our apps are with a minimum target of iOS 17 and I tested it on an iPhone 11 with Portuguese language and Siri in Portuguese
1
0
107
Jul ’25
AppIntent take a photo?
Hi i'm new to swift/swiftui i want to my app shortcut to have the ability to take a photo within my AppIntent instead of having to configure a 'Take a photo' action in the Shortcuts app and then parsing that to my Appintent (for less human error). Is this possible? I read there's a protocol called CameraCaptureIntent but i think it's only used for a separate extension like for Control Center, Lock Screen, and Action buttons :(
0
0
56
Jul ’25
How to get the "Is Completed" and "Is Not Completed" Filter in Shortcuts app like Reminders
When we use the "Find All Reminders" shortcut, there's these two filters "Is Completed and "Is Not Completed". When I implement this in my app, the best I could get is just "Completed" and "Not Completed", I can't figure out how to add the "Is" in front. In my entity: @Property(title: "Completed") var completed : Bool In the EntityPropertyQuery: static var properties = QueryProperties { Property(\GTDItemAppEntity.$list) { EqualToComparator { NSPredicate(format: "list.uuid = %@", $0.id as NSUUID) } } Property(\GTDItemAppEntity.$text) { ContainsComparator { NSPredicate(format: "text CONTAINS[cd] %@", $0) } EqualToComparator { NSPredicate(format: "text = %@", $0) } } Property(\GTDItemAppEntity.$completed) { EqualToComparator { NSPredicate(format: $0 ? "completed = YES" : "completed = NO") } } } If I change the property to @Property(title: "Is Completed") var completed : Bool Then it will show as "Is Completed" and "Not Is Completed" in the filter! Reminder: My App:
1
0
127
Jul ’25
Ask Each Time on macOS doesn't not allow empty selection
Hello! I'm facing a strange behavior on macOS related to Ask Each Time, which works fine on iOS. I've an App Intent that declares a parameter like so: @Parameter( title: "Tags", description: "Tags to add to the link.", optionsProvider: TagsOptionsProvider() ) var tags: [String]? The TagsOptionProvider is like this: struct TagsOptionsProvider: DynamicOptionsProvider { @Dependency private var modelCoordinator: ModelCoordinator @MainActor func results() async throws -> [String] { return modelCoordinator.tags().compactMap { $0.name } } } Now, the issue comes if I create a shortcut where for the tags parameter the user selects the magic variable Ask Each Time. On iOS, when the user is presented with the selector, they can simply tap 'Done' without selecting any value (the user does not want to include any tag). The problem is that on macOS the 'Done' button is disabled if there's no selection. See both behaviors: iOS: macOS: Question: Is there a way to let macOS continue even if the user doesn't select any of the available options like on iOS? I've tried declaring the tags para meter as Optional (like on the screenshot) and non-optional, both cases show the same behavior. Environment: iOS 18.5 macOS 15.5
1
0
227
Jul ’25