0

I've created a Siri Intent as described in the following tutorial: link to the tutorial

I've added a single intent with a single paramter. I haven't donated the intent. I can't see the intent in "Siri Shortcuts" page in Settings.

Should the intent be donated, before becoming visible in Siri Settings?

In my app the balance is always shown in the homepage, so should I donate the shortcut each time the user views the homepage? Is it possible to specify the shortcut as "available", so it would be automatically added to the settings upon app installation?

Settings page

Richard Topchii
  • 7,075
  • 8
  • 48
  • 115

1 Answers1

1

You can suggest shortcuts, although the user did not execute the specific action in the app, which would have caused a donation. For this, you have to create Suggestions, which might be interesting for the user, and give them to the INVoiceShorcutCenter.

The following code might help you:

var suggestions : [INShortcut] = []

let intent = CustomIntent()
intent.name = "Suggested Shortcut"

if let image = UIImage(named: "intenticon"), let data = image.pngData() {
   intent.setImage(INImage(imageData: data), forParameterNamed:\CustomIntent.name)
}

intent.suggestedInvocationPhrase = "Show the name"
if let shortcut = INShortcut(intent: intent) {
   suggestions.append(shortcut)
}       

// Suggest the shortcuts
INVoiceShortcutCenter.shared.setShortcutSuggestions(suggestions)

To delete all suggestions, you just suggest an empty INShortcut array.

Phil_G
  • 293
  • 1
  • 9