Getting Siri Shortcut to show up on watch face

I've got Siri Shortcuts implemented on iOS 12 by donating custom intentions. They show up (with the developer settings turned on) right away on the lock screen as expected, and they launch the app.


I can't seem to get them to show up on the watch app now, and the WWDC videos are very light on actual code samples. I'm taking my intent subclasses and generating relevant shortcuts from them, but no matter what they won't show up in the Siri Watch Face.


  let resultsIntent = SeeResultsIntent()
  let resultsShortcut = INRelevantShortcut(shortcut: INShortcut(intent: resultsIntent)!)
  resultsShortcut.relevanceProviders = [INDateRelevanceProvider(start: Date().dateByAdding(minutes: 5), end: Date().dateByAdding(days: 1))]

  INRelevantShortcutStore.default.setRelevantShortcuts([resultsShortcut]) { error in
  if let error = error {
    NSLog("Error setting relevant shortcuts: \(error)")
  } else {
    NSLog("Siri watch face shortcuts loaded")
  }
 

I've tried running this same code on the iOS app and on the watch app extension, doesn't seem to matter. How can I debug this? How can I test this and verify they're being recorded? Do the settings in the iOS Developer menu about showing donated intents affect the Siri watch face as well? Where do I go from here?

Accepted Reply

Have you added an list of your custom intent class names to NSUserActivityTypes property also on your watch app's Info.plist ?

In our case, that fixed the issue.

Replies

Just to provide a little more info, I do have all the developer settings enabled, and I've tapped the force sync to watch button in there as well. It doesn't give any indication that it did or didn't do anything, but let's assume it does.


Also my app doesn't show up in the Apple Watch app as a 3rd party source for the Siri watch face. Should it?

I haven't done anything with this myself, but I am on the beta for several apps using this and I can confirm that it is currently possible for apps to show both in the list of sources and on the siri face. (Obviously your watch has to be on watchOS 5)

Have you added an list of your custom intent class names to NSUserActivityTypes property also on your watch app's Info.plist ?

In our case, that fixed the issue.

Thank you so much, this led me down the path to find the solution. I had put the NSUserActivityTypes in the watch extension Info.plist (because that's the part that handles the activity) and not the watch app Info.plist. I moved it and now it all started working.

Hello,


This helped me to fix the issue, but it only works when i install app by xcode debugging.

When install adhoc build, it don't show cards on watch siri face.


Any idea why this happens, does it also happens to you too?


Thanks

Hiren