I’ve been trying to setup AppIntents
and respective AppShortcuts
on my WatchOS target, but they don’t show up in the Watch’s Shortcuts app.
Using the same setup, it works just fine on the iOS companion. Documentation says AppIntents
works with WatchOS, so surely I must have overlooked something? Unfortunately I couldn’t find anything relating to the topic online…
EDIT: Running the same build on hardware (iPhone SE: iOS 16.4 + Watch SE: WatchOS 9.4), the shortcuts don’t even show up in iOS, while they do in the simulator?!
Now, I could implement the functionality on the companion app and relay the resulting state, but I’d prefer to do it on Watch (trying to avoid some unnecessary extra work). So, any help would be much appreciated. Thanks!
2
Answers
Anyone, having problems with App Intents not appearing in your Shortcuts app, have a look at the build log. Search for "intents metadata" and expand the transcript.
It helped in my particular case, initializing a
TypeDisplayRepresentable
in the "wrong" way. Quite a funny error to waste almost 2 days on:Shortcuts I put on Watch still don't show in the shortcuts app, but I guess they probably aren't supposed to? Who really knows.
Today I managed to get Siri to actually show up the App Shortcuts. When first saying the trigger phrase Siri would ask if the shortcuts should be activated and it would show all available shortcut phrases.
BUT when I then say the shortcut, Siri does something, but nothing is done. I made an empty shortcut just returning a dialog with Test succeeded.
Here’s the entire code for the watchOS App Intents extensions.
Overall I think this feature is not used by any watchOS developers (but @szagun and me?). I will submit a radar/feedback to Apple.
You can see the confirmation dialog below:
EDIT:
I actually got it working, the solution was rather simple.