In my app, when invoking a Shortcut via Siri, the
application(_:continueUserActivity:restorationHandler:)
method in AppDelegate is called twice.
When I debug, both NSUserActivity objects are identical.
However, when I run the same Shortcut by tapping it manually, the method is only called once as expected.
Has anyone experienced this issue? How can I prevent Siri Shortcuts from delivering the same NSUserActivity twice?
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
100 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm trying to run sample Trails app from the documentation, unaltered.
When I do the build, I get a
Command ValidateAppShortcutStringsMetadata failed with a nonzero exit code
error. How do I debug this?
I'm trying this on Xcode 16.4.
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?
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.
I'm soliciting you because I'm having a problem using the 3D short cut for my ios application in uikit in the AppDelegate file but it's impossible to redirect the route when the user has completely killed the application. It works as a background application. I'd like it to redirect to the searchPage search page when the application is fully closed and the user clicks on search with 3D touch.
final class AppDelegate: UIResponder, UIApplicationDelegate {
lazy var window: UIWindow? = {
return UIWindow(frame: UIScreen.main.bounds)
}()
private let appDependencyContainer = Container()
private let disposeBag = DisposeBag()
var pendingDeeplink: String?
private lazy var onboardingNavigationController: UINavigationController = {
let navigationController = UINavigationController(nibName: nil, bundle: nil)
navigationController.setNavigationBarHidden(true, animated: false)
return navigationController
}()
private func handleShortcutItem(_ shortcutItem: UIApplicationShortcutItem) {
guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first(where: { $0.isKeyWindow }),
let rootVC = window.rootViewController else {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { [weak self] in
self?.handleShortcutItem(shortcutItem)
}
return
}
if let presentedVC = rootVC.presentedViewController {
presentedVC.dismiss(animated: !UIAccessibility.isReduceMotionEnabled) { [weak self] in
self?.executeShortcutNavigation(shortcutItem)
}
} else {
executeShortcutNavigation(shortcutItem)
}
}
private func executeShortcutNavigation(_ shortcutItem: UIApplicationShortcutItem) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
guard let self = self else { return }
switch shortcutItem.type {
case ShortcutType.searchAction.rawValue:
self.mainRouter.drive(to: .searchPage(.show), origin: AppRoutingOrigin())
case ShortcutType.playAction.rawValue:
self.mainRouter.drive(to: .live(channel: Channel(), appTabOrigin: AppTabOrigin.navigation.rawValue), origin: AppRoutingOrigin())
case ShortcutType.myListHistoryAction.rawValue:
self.mainRouter.drive(to: .myList(.history), origin: AppRoutingOrigin())
default:
break
}
}
}
What I've tried:
Adding delays with DispatchQueue.main.asyncAfter
Checking for window availability and rootViewController
Dismissing presented view controllers before navigation
Environment:
iOS 15+
Swift 6
Using custom router system (mainRouter)
App supports both SwiftUI and UIKit
Questions:
What's the best practice for handling shortcuts on cold launch vs warm launch?
How can I ensure the router is properly initialized before navigation?
Issue: CSV Headings Not Appearing in Shortcut-Generated File
I'm using an iPhone 16 Pro with iOS 18.5 and the latest Shortcuts app to log expenses into a CSV file. The shortcut works fine, except the resulting file doesn't include the column headings.
Here’s what I’ve done:
Created a file called Expenses.csv with this single header line:
Date,Price,Category,Store,Notes,Location
Saved it to both /iCloud Drive and /iCloud Drive/Shortcuts (via iCloud on my Windows PC).
My Shortcut builds the CSV line from inputs (date, price, category, etc.) and appends it to the file.
I renamed the variables only in the final “Text” block, since renaming in earlier blocks seems no longer possible in this Shortcuts version.
Despite this setup, the file doesn’t preserve the header row—it either doesn’t show up, or gets overwritten.
Goal:
Have a persistent CSV file with the correct headers once, and each new entry appended below the correct columns.
Can anyone help me figure out what I’m doing wrong?
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:
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?
Hello,
I have two related questions:
in this AppIntent:
https://github.com/poml88/FLwatch/blob/moresimple/SharedPhoneWatch/AppIntents/AddInsulin.swift#L2
i am trying to work with are returned Double as the parameter.
But it does not fully work, because
there is a locale issue. in some languages the decimal point is a comme. If that is so, Siri returns 3,5 but the system does not use it as a double. How to solve that?
or, she is returning five, not 5 and again. The system does not recognise the double.
It seems Apple has some resolvers for this, for example: DoubleFromStringResolver.
https://developer.apple.com/documentation/appintents/resolvers
But I cannot figure out how to use them are how to call that resolver.
Can somebody help, please?
Thanks.
I’m looking into activating my gate (has a dedicated app to it) while getting near home.
i thought that a combination of Car bluetooth connection/Carplay connection as well as a 50 meter radius from home location would be nice to trigger the gate app.
However, I find it hard to set these 2 parallel conditions in Shortcuts. I managed to set connection to car’s Bluetooth, but next screen would suggest the “do” action rather than offer additional conditions.
i couldn‘t handle the “if” option.
would like some help.
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
Hello!
I am excited to try out the new continueInForeground API with iOS 26.
I was wondering, what is the suggested way to transport meta data to the main app?
Before, with SiriKit intents I would use the .onContinueUserActivity() API and were able to pass a NSUserActivity from the Shortcut to the Main app.
Now, with the continueInForeground() call I am not sure – what would be your suggestion?
Of course, I can store some data in UserDefaults, but that feels like a workaround.
Happy to get some input on this!
Thanks a lot and have a great day!
I have an App Intent that conforms to ShowsSnippetView and returns a view that is shown in the Siri interface after the shortcut runs. The view simply consists of a VStack with a Text element, with no special styling. When my device is set to dark mode, the view doesn't adapt: the text is black, but the background of the Siri interface is a transparent dark gray, which makes the text almost unreadable. The text should be white in dark mode. The colorScheme environment value inside the view corresponds to light mode, even though the device is set to dark mode. This is most likely a bug in iOS.
In the Get to Know App Intents WWDC session, it was said
New this year, you can now add Spotlight indexing keys directly on properties. Annotating properties allows Spotlight to show more relevant information to customers. When donating indexed entities, the framework will handle creating the searchable item and attribute set for you. After donating entities, they can be found in Spotlight.
How do you donate indexed app entities?
Making app entities available in Spotlight seems to state it's not necessary to donate entities:
The system can automatically extract the keys for Spotlight indexing at compile time and store them in the App Intents metadata that Xcode generates as part of your app’s bundle. As a result, Spotlight indexing is faster and can find your app entities without launching your app, and without you having to explicitly donate the entities to Spotlight. You also don’t need to manually update or remove entities from the Spotlight index when your app’s data changes.
Say I have a CarEntity. The user can create/update/delete cars at any time. What is the modern way to get cars to appear in Spotlight in iOS 26?
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
iOS
Spotlight
Shortcuts
App Intents
Hi! I am using the Automations in shortcuts in macOS 26 dev beta 1 and I have all my shortcuts working except this one. Why?(photo included). All the others are very similar except they do other things not make pdf. They work. Why does this one not. I tried changing the extension to .doc, or .docx instead of doc and docx I tried using if name ends in .docx I tried file filtering nothing. Any ideas? Thanks!
I have an app that lets you create cars. I have a CarEntity, an OpenCarIntent, and a CreateCarIntent. I want to support the Open When Run option when creating a car. I understand to do this, you just update the return type of your perform function to include & OpensIntent, then change your return value to include opensIntent: OpenCarIntent(target: carEntity). When I do this, I get a compile-time error:
Cannot convert value of type 'CarEntity' to expected argument type 'IntentParameter<CarEntity>'
What am I doing wrong here?
struct CreateCarIntent: ForegroundContinuableIntent {
static let title: LocalizedStringResource = "Create Car"
@Parameter(title: "Name")
var name: String
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<CarEntity> & OpensIntent {
let managedObjectContext = PersistenceController.shared.container.viewContext
let car = Car(context: managedObjectContext)
car.name = name
try await managedObjectContext.perform {
try managedObjectContext.save()
}
let carEntity = CarEntity(car: car)
return .result(
value: carEntity,
opensIntent: OpenCarIntent(target: carEntity) // FIXME: Won't compile
)
}
}
struct OpenCarIntent: OpenIntent {
static let title: LocalizedStringResource = "Open Car"
@Parameter(title: "Car")
var target: CarEntity
@MainActor
func perform() async throws -> some IntentResult {
await UIApplication.shared.open(URL(string: "carapp://cars/view?id=\(target.id)")!)
return .result()
}
}
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
iOS
Shortcuts
Intents
App Intents
I'm currently trying to use the new @UnionValue macro.
From what I understood, it allows multiple types for a parameter.
I created the following enum:
@UnionValue
enum IntentDuration {
case int(Int)
case duration(Measurement<UnitDuration>)
}
Then, I tried to use it in the following AppIntent:
struct MyIntent: AppIntent {
static let title: LocalizedStringResource = "intent.title"
static let description = IntentDescription("intent.description")
static let openAppWhenRun: Bool = true
@Parameter var duration: IntentDuration
@Dependency
private var appManager: AppManager
@MainActor
func perform() async throws -> some IntentResult {
// My action
return .result()
}
}
However, I get the following error from Xcode at the @Parameter line:
'init()' is unavailable
Did I wrongly understand how this works? Is there another way to accept multiple types for a parameter?
I didn't manage to find any docs on this.
My app uses App Intents to create App Shortcuts.
When I build and run my app in Xcode, the App Shortcuts Preview tool (under Product menu) shows the following message:
No Flexible Matching Assets
This target is for a platform which is not supported by Flexible Matching or does not have Flexible Matching enabled.
All of my project's targets are iPhone only with a minimum deployment of 18.0. In the build settings for this project, Enable App Shortcuts Flexible Matching is set to Yes. (build settings reference)
Any guidance on how to troubleshoot this? Thank you!
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
Xcode
Siri and Voice
Shortcuts
App Intents
Hey everyone,
I have an issue I'm running into – maybe someone has the expertise to help!
I've created an app that adds Intents to the Shortcuts app, to interact with S3-compatible object storage. Everything works fine, until you decide to upload/download a large file, that your internet connection cannot handle in the ~30-second intent timeout.
I've explored uploading files with a background task which seems to work somehow, but the bigger issue would be downloading larger files, as other parts of the subsequent shortcut may rely on it.
To the question: Is there some way of increasing the timeout for a shortcuts intent, or a way to "trick" shortcuts into letting my custom intents download/upload files without timing out?
Thanks so much!
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
Shortcuts
Background Tasks
Intents
App Intents
Hello Shortcuts community!
I want to obtain a list of my notes, and well, update them, delete them if needed, and so on. These are simple actions that I can already do.
For this, I saw that shortcuts was pretty simple, and I could get what I wanted and pipe it through the terminal. However, even though I'm a programmer, there's a lot that I'm missing since I cannot pipe anything to the terminal.
I made a simple shortcut to give me some text, and I could obtain it via -shortcuts run "Example" | cat-, which well, gave me the output but with a %.
aaa**%**
Now, I guess this works, the important thing is for me to obtain something from shortcuts so that I can configure simple things like obtaining a note, a mail, run some javascript in the browser and so on while obtaining some output via the terminal.
So, I configured something like this:
While I do get a dictionary (only in the shortcuts app, not in the terminal) like:
{ "Title": "Some title" }
And actually a list of them, I don't have them in an array that I would have for my command. And for some reason I've only been able to obtain either the name or the body.
Now, I put them into a text with get text from Repeated results, but I don't think I have a valid Dictionary (JSON) array that I can use, since the terminal doesn't obtain nothing.
So far I've tried:
echo $(shortcuts run "Find Notes")
echo $(shortcuts run "Find Notes" --output-type public.utf8-plain-text -o -)
shortcuts run "Find Notes" | xargs
I wonder what am I missing. I'm not creating the array of dictionaries like I'd like, nor outputting it.
On the other hand, I have some AppleScripts that work, however, given that I cannot find munch information about the support status of AppleScript, I though to update to Shortcuts which is obtaining updates, and then I'm trying to do this simple example on shortcuts.
Thanks for taking a look!