iosswiftwatchossirishortcutsappintents

AppIntents and AppShortcuts not showing up on WatchOS


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!


Solution

  • 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:

    // this works
    static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Prüfung")
    
    // this does not
    static var typeDisplayRepresentation : TypeDisplayRepresentation = .init(name: "Prüfung")
    

    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.