Creating Shortcuts with App Intents | Kodeco

This content was released on Oct 2 2023. The official support period is 6-months from this date.

Learn how to create iOS shortcuts using Swift in this App Intents tutorial.


This is a companion discussion topic for the original entry at https://www.kodeco.com/40950083-creating-shortcuts-with-app-intents

The code is broken using Xcode 15 I think they changed the AppIntent Api so the article is outdate. Please check uploaded image for more details

Code works fine for me in 15.

actualice para Mac, comenzando por el starter-project, pero no me funciono, valide su articulo.
El project complete-project, funciona para macOS.

PORFAVOR SIEMPRE VALIDA TU ARTICULO.

no funciona para macOS , se supone q debe funcionar para ambos, ademas siguiendo el articulo tiene errores q no deben funcionar en iOS

Hi @jorge_mz. The project was written to support iOS. It will run in compatibility mode (designed for iPad) on a Mac. I just built the completed materials and ran it on the iOS simulator with no issues in the latest Xcode (15.2)

In " Adding an App Shortcut", I had trouble to get Siri to respond to the shortcut until I revisited the “Bring your app’s core features to users with App Intents” WWDC24 session, and noticed that “phrases (…) must contain the app name”.

So I changed "Log a break" to "Log a break in \(.applicationName)" and this seems to have fixed the issue.

This overload of the result method is “Available when SwiftUI is imported with AppIntents” per its current definition file. Adding import SwiftUI fixes this error.