SiriKit Integration 2023?

Hey Andrew, so I tried implementing the tutorial I recommended, and indeed, at first it would not work.

But now it does work!

Some stuff I learnt along the way:

  1. The Apple documentation is not perfect, don’t always trust it. For example, at 7:23 of this video, the code does not compile → Dive into App Intents - WWDC22 - Videos - Apple Developer
  2. The tutorial I sent you successfully creates the Shortcuts in the user’s phone without any user interaction (you can check your phone’s “Shortcuts App” after installing your prototype). The tricky part is to activate the Shortcut with a voice command to Siri. I found many people struggling with this as well → App Intent not Discoverable by Siri | Apple Developer Forums
  3. According to Apple, for the Siri voice command to get triggered, it’s important for Siri to identify your app (hence the “.applicationName” here). See this video at 3:37 → Implement App Shortcuts with App Intents - WWDC22 - Videos - Apple Developer
 AppShortcut(
            intent: SiriAddOne(),
            phrases: ["Add one to \(.applicationName)"]
        )
  1. I made sure Siri knew the name of my app (which I called “MyCounter”). I set this in the info.plist of the app. Found the info here →
    Specifying Synonyms for Your App Name | Apple Developer Documentation
    and here → Technical Q&A QA1950: Hey Siri, How Can I Improve the Recognition of My App's Name?
  2. According to the people complaining in the link in my bullet point n°(2), once you build and install the app on your phone, it can take a while for Siri to learn your app’s name. (Some people say a few hours, others say 10min - but the point is it takes a while).

Anyway. After all this, for me it works. When I say: “Hey Siri, add one to my counter”, the shortcut gets triggered, the app opens, and my counter increments.

I wonder what could be built with this power :star_struck:

I hope you can make it work now, good luck Andrew!

(totally unrelated, but I just realized there’s a cake emoji :cake: next to my name because today is my 2nd-year anniversary on the forum haha. That’s funny)

1 Like