title: Shortcut/Action on Siri Watch Face with independent WatchOS app
body: <p>I'm relatively new to making apps, and even newer to independent watch apps. As training, I'm making a watch app that I can use to log my water intake throughout the day. I've created a new intent definition file (see image 1) on which I've checked the marks for all the target memberships (the app, the WatchKit app, and the WatchKit extension). Furthermore, the target membership class is a public intent for the WatchKit extension.</p>
  <p>When logging my water I execute the following code:</p>
  <pre class="lang-swift prettyprint-override"><code>let intent = INManager.intent(drink: item)
  INManager.donateShortcuts(withIntent: intent)
  </code></pre>
  <p>and my IntentManager looks like this:</p>
  <pre class="lang-swift prettyprint-override"><code>import Foundation
  import Intents
  
  class IntentManager {
      
      func intent(drink: Drink) -&gt; LogDrinkIntent {
          let intent = LogDrinkIntent()
          
          intent.uuid = drink.id.uuidString
          intent.name = drink.name
          intent.emoji = drink.emoji
          
          return intent
      }
      
      func donateShortcuts(withIntent intent:INIntent) {
          var relevantShortcuts: [INRelevantShortcut] = []
          
          if let relevantShortcut = defaultRelevantShortcut(withIntent: intent) {
              relevantShortcuts.append(relevantShortcut)
          }
          
          INRelevantShortcutStore.default.setRelevantShortcuts(relevantShortcuts) { (error) in
              if let error = error {
                  print(&quot;Failed to set relevant shortcuts: \(error))&quot;)
              } else {
                  print(&quot;Relevant shortcuts set.&quot;)
              }
          }
      }
      
      private func defaultRelevantShortcut(withIntent intent: INIntent) -&gt; INRelevantShortcut? {
          if let shortcut = INShortcut(intent: intent) {
              let relevantShortcut = INRelevantShortcut(shortcut: shortcut)
              relevantShortcut.shortcutRole = .action
              
              let template = INDefaultCardTemplate(title: &quot;Log Drink&quot;)
              relevantShortcut.watchTemplate = template
  
              print(&quot;Returning relevant shortcut.&quot;)
              
              return relevantShortcut
          }
          
          return nil
      }
  }
  </code></pre>
  <p>When logging a drink the confirmation <code>Returning relevant shortcut.</code> and <code>Relevant shortcuts set.</code> are printed. However, the Siri watch face doesn't update to include a link to my action. I got the code for the <code>IntentManager</code> from <a href="https://medium.com/@abdul.i.aljebouri/relevant-shortcuts-on-siri-watch-face-b1a5ed946d19" rel="nofollow noreferrer">this Medium article</a>.</p>
  <p>I really appreciate your time and help. I've had a hard time trying to find <em>any</em> details about this functionality and Apple's documentation is imo inferior. Thank you! If you need more details or such, feel free to ask.</p>
  <p>Image 1
  <img src="https://i.stack.imgur.com/pI8gn.png" alt="Intent definition file" /></p>