Hi Devs,
I’ve created an app intent shortcut for our Best Buy app. This shortcut is visible on iOS 17.2 and later. However, I’ve marked it to support iOS 16+ as shown below:
import AppIntents
@available(iOS 16.0, *)
struct LaunchIntent: OpenIntent {
why we are not able to see shortcuts for iOS 16?
Shortcuts
RSS for tagHelp users quickly accomplish tasks related to your app with their voice or with a tap with the Shortcuts API.
Posts under Shortcuts tag
114 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I've been exploring the Trails Sample App from this session at WWDC24.
The app has a TrailEntity of type AppEntity which is leveraged in multiple places throughout the app, including:
The GetTrailInfo App Intent with a trail parameter of type TrailEntity.
A parameterized App Shortcut which calls the GetTrailInfo intent.
The TrailDataManager's init calls updateSpotlightIndex(), which creates a CSSearchableItem for each Trail in the app, along with an associateAppEntity call linking the corresponding TrailEntity to each item that gets added to the CSSearchableIndex.
If you build the app and search "trails" in Spotlight, the Trails Sample App section includes instances of TrailEntity as search results. But if you comment out the App Shortcut that takes a TrailEntity as a parameter and rebuild, there are no instances of TrailEntity in the search results. In both cases, the console prints [Spotlight] Trails indexed by Spotlight.
Is this expected behavior? Why are the TrailEntity instances only appearing in Spotlight via the App Shortcut? Shouldn't the CSSearchableItem instances show up in Spotlight on their own regardless? If not, then what is the purpose of adopting Core Spotlight with App Entities? Does this add the app entities to the semantic index for "new Siri", even though they're not user facing in the Spotlight UI?
I have an App Intent that returns a MyEntity value with the following properties:
struct MyEntity: AppEntity {
@Property(title: "Title")
var title: String?
@Property(title: "Image")
var image: IntentFile?
}
I created a Shortcut that takes the output value of this intent and passes it as the input to the Send Message action. When I tap the MyEntity parameter in the message action, it shows to be of Type MyEntity. Below that, I can select 1 of 3 options: MyEntity, Title, or Image.
When I run the shortcut, a new message compose window appears with the following behavior depending on the selected option:
MyEntity - the message draft is empty
Title - the message draft shows the title string
Image - the message draft shows the image
My expected and desired result when MyEntity is selected would be a message draft populated with the image and the title string as text. How would I achieve this? Is it possible?
I've experimented with conforming MyEntity to Transferable. That's enabled use cases such as passing the MyEntity input as Type Image for example.
Do I need to create a custom UTType to represent MyEntity, or is that unrelated to my issue? I haven't explored this yet but seems potentially related!
I made a macOS document-based app that has a second scene that's a Window. It's name appears in the single window list of the Windows menu, but has no assigned shortcut. I've tried the following to assign a shortcut to it, but it doesn't add a "⌘L" as I want:
Window("Logs", id: "logs") {
LogsView()
}
.keyboardShortcut("l")
I can brute-force this using .commands to replace the menu item but that seems crude and unnecessary. Is it the only way?
Everytime i open the app shortcuts and go to text to speech when i press play the outcome is an evil laugh. What‘s happening? Is it a bug or? Im on ios 18.3
I have an image based app with albums, except in my app, albums are known as galleries.
When I tried to conform my existing OpenGalleryIntent with @AssistantIntent(schema: .photos.openAlbum), I had to change my existing gallery parameter to be called target in order to fit the predefined shape of this domain.
Previously, my intent was configured to display as “Open Gallery” with the description “Opens the selected Gallery” in the Shortcuts app. After conforming to the photos domain, it displays as “Open Album” with a description “Opens the Provided Album”.
Shortcuts is ignoring my configured title and description now. My code builds, but with the following build warnings:
Parameter argument title of a required Assistant schema intent parameter target should not be overridden
Implementation of the property title of an AppIntent conforming to AssistantSchemaIntent should not be overridden
Implementation of the property description of an AppIntent conforming to AssistantSchemaIntent should not be overridden
Is my only option to change the concept of a Gallery inside of my app into an Album? I don't want to do this... Conceptually, my app aligns well with this domain does, but I didn't consider that conforming to the shape of an AI schema intent would also dictate exactly how it's presented to the user.
FB16283840
Given that iOS 18.2 is out and following documentation and WWDC example (limited to iOS 18.2+), I am attempting to use @AssistantIntent(schema: .system.search) along an AppIntent.
Questions:
Has anyone made this to work on a real device?!
In my case (code below): when I run the intent from Shortcuts or Siri, it does NOT open the App but only calls the perform method (and the App is not foregrounded) -- changing openAppWhenRun has no effect! Strangely: If my App was backgrounded before invocation and I foreground it after, it has navigated to Search but just not foregrounded the App!
Am I doing anything wrong? (adding @Parameter etc doesn't change anything).
Where is the intelligence here? The criteria parameter can NOT be used in the Siri phrase -- build error if you try that since only AppEntity/AppEnum is permitted as variable in Siri phrase but not a StringSearchCriteria.
Said otherwise: What's the gain in using @AssistantIntent(schema: .system.search) vs a regular AppIntent in this case?!
Some code:
@available(iOS 18.2, *)
@AssistantIntent(schema: .system.search)
struct MySearchIntent: ShowInAppSearchResultsIntent {
static let searchScopes: [StringSearchScope] = [.general]
static let openAppWhenRun = true
var criteria: StringSearchCriteria
@MainActor
func perform() async throws -> some IntentResult {
NavigationHandler().to(.search(.init(query: criteria.term)), from: .siri)
return .result()
}
}
Along with this ShortCut in AppShortcutsProvider:
AppShortcut(
intent: MySearchIntent(),
phrases: [
"Search \(.applicationName)"
],
shortTitle: "Search",
systemImageName: "magnifyingglass"
)
Creating my first IOS appIntents.
I created two simple appIntents. One to create a random number and the other to store it (actually it just prints it).
Yet, when I run a shortcut that connects the two, the one that stores it is not receiving the entity.
It receives nil instead of the entity created in the first step.
I've been following along with "App Shortcuts" development but cannot get Siri to run my Intent. The intent on its own works in Shortcuts, along with a couple others that aren't in the AppShortcutsProvder structure.
I keep getting the following two errors, but cannot figure out why this is occurring with documentation or other forum posts.
No ConnectionContext found for 12909953344
Attempted to fetch App Shortcuts, but couldn't find the AppShortcutsProvider.
Here are the relevant snippets of code -
(1) The AppIntent definition
struct SetBrightnessIntent: AppIntent {
static var title = LocalizedStringResource("Set Brightness")
static var description = IntentDescription("Set Glass Display Brightness")
@Parameter(title: "Level")
var level: Int?
static var parameterSummary: some ParameterSummary {
Summary("Set Brightness to \(\.$level)%")
}
func perform() async throws -> some IntentResult {
guard let level = level else {
throw $level.needsValueError("Please provide a brightness value")
}
if level > 100 || level <= 0 {
throw $level.needsValueError("Brightness must be between 1 and 100")
}
// do stuff with level
return .result()
}
}
(2) The AppShortcutsProvider (defined in my iOS app target, there are no other targets)
struct MyAppShortcuts: AppShortcutsProvider {
static var shortcutTileColor: ShortcutTileColor = .grayBlue
@AppShortcutsBuilder
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: SetBrightnessIntent(),
phrases: [
"set \(.applicationName) brightness to \(\.$level)",
"set \(.applicationName) brightness to \(\.$level) percent"
],
shortTitle: LocalizedStringResource("Set Glass Brightness"),
systemImageName: "sun.max"
)
}
}
Does anything here look wrong? Is there some magical key that I need to specify in Info.plist to get Siri to recognize the AppShortcutsProvider?
On Xcode 16.2 and iOS 18.2 (non-beta).
Hello everyone,
I would like to dictate a text with Shortcuts and then send it to one of two e-mail addresses (private or business).
I would like to be able to select one of two email addresses.
Unfortunately, I am not able to pass an email address as a parameter to the Send email function. Is it possible to do this?
I'm new to apple and I'm all but not a programmer. So take pity on me :)
Best, Niko
Exploring AppIntents and Shortcuts. No matter what I try Siri won't understand parameters in an initial spoken phrase.
For example, if I ask: "Start my planning for School in TestApp", Siri responds: "What's plan?", I say: "School" and Siri responds "Ok, starting Shool plan"
What am I missing so it won't pick up parameters right away?
Logs inside func entities(matching string: String) are only called after "What's plan?" question and me answering "School". No logs after the initial phrase
Tried to use Apple's Trails example as a reference but with no luck
I’m trying to run a Shortcut from my iPhone’s Action button and immediately dictate input by voice, without tapping or switching modes.
Currently, it always defaults to a text field. Voice dictation works seamlessly if I trigger the shortcut via a voice command, but not when I use the Action button.
Is there a way, API, or future plan from Apple to allow voice dictation after the Action button triggers a Shortcut? Any guidance or ideas would be really helpful!
I have a very basic App Intent extension in my macOS app that does nothing than accepting two parameters, but running it in Shortcuts always produces the error "The action “Compare” could not run because an internal error occurred.".
What am I doing wrong?
struct CompareIntent: AppIntent {
static let title = LocalizedStringResource("intent.compare.title")
static let description = IntentDescription("intent.compare.description")
static let openAppWhenRun = true
@Parameter(title: "intent.compare.parameter.original")
var original: String
@Parameter(title: "intent.compare.parameter.modified")
var modified: String
func perform() async throws -> some IntentResult {
return .result()
}
}
The Verify the behavior of your intent in Simulator or on-device documentation says that it's sufficient to build and run the app and open the Shortcuts app to test an app intent, but that doesn't seem to be the case. I always needed to at least move the debugged app to the Applications folder before the app intents showed up in Shortcuts, and even then, most of the times I also need to wait a lot or restart the Mac. When updating an existing app intent (for instance by changing its title), building the app, overwriting the existing one in the Applications folder and restarting Shortcuts is not sufficient to make the new title appear in Shortcuts.
Is there an efficient way to test app intents in the Shortcuts app? I already created FB15638502 one month ago but got no response.
I rarely use the Shortcuts app, so it took me a while to notice that my app's app intents all show incorrectly on macOS 15. On macOS 14 and 13, they used to show correctly, but now it seems that all localized strings show the key rather than the localized value.
@available(iOS 16.0, macOS 13.0, *)
struct MyAppIntent: AppIntent {
static let title = LocalizedStringResource("key1", comment: "")
static let description = IntentDescription(LocalizedStringResource("key2", comment: ""))
...
}
In Localizable.xcstrings file I have defined all the strings, for instance I have associated key1 with the value Title, but while the Shortcuts app used to display Title, it now displays key1.
Is this a known issue or did something change in macOS 15 that would require me to update something?
Hi!
So while Date is supported for @Parameter in an App Intent, I just discovered that Xcode will not let me use use it in a parametrized App Shortcut phrase.
In my case, I would like to give the option to say "today", tomorrow", or "day after tomorrow" for the date. Am I missing something? Any hints on the best way to approach this?
Hi!
In neither Xcode 16.2 beta 3 nor Xcode 16.2 I am able to get App Shortcuts Preview to recognise my Shortcuts. In either supported language I always get "No Matching Intent" as the result.
Flexible matching is enabled, minimum deployment target is iOS 18. The Shortcut phrases do work in the simulator and on device.
Is this a known issue or am I missing something?
There is a bug when try to open the push notification of appintent at the lock screen.
How to determine whether the shortcut command is triggered by Siri or the user clicks?
Hi!
SiriTipView(intent:) shows the first phrase for my App Shortcut, but unlike ShortcutsLink(), does not use the localized applicationName. Hence the phrase shown does not work 😬
Is this a known limitation, any workarounds?