skip to Main Content

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


  1. Chosen as BEST ANSWER

    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.


  2. 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.

    @main
    struct SiriAppIntentsExtensionTestExtension: AppIntentsExtension {
    }
     
    struct SiriAppIntentsExtensionTest: AppIntent {
        static var title: LocalizedStringResource = "Test Intent"
        
        func perform() async throws -> some IntentResult {
            return .result(dialog: IntentDialog("Test succeeded"))
        }
    }
    
    struct AppIntentsShortcutProvider: AppShortcutsProvider {
        static var appShortcuts: [AppShortcut] {
            return [
                AppShortcut(intent: SiriAppIntentsExtensionTest(),
                            phrases: ["Show my orders in (.applicationName)",
                                      "Zeige meine Bestellungen in (.applicationName)" ], // German translation for my evaluation
                            shortTitle: "Test", systemImageName: nil)
            ]
        }
    }
    
    

    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:

    This picture shows the Siri confirmation process

    EDIT:

    I actually got it working, the solution was rather simple.

    1. Remove the App Intents Extension completely.
    2. Add all Intents and shortcuts to the Apple Watch App Extension.
    3. Execute the shortcuts by saying the trigger phrase.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search