Make suggestions for shortcuts the user may want to add to Siri.
After the user performs an action in your app, the app should donate a shortcut that accelerates user access to the action. However, sometimes there are actions in your app the user hasn’t performed that might be of interest to them. For example, perhaps your soup-ordering app features a special soup every day. The user has never ordered the daily soup special, but they might be interested in the option to add a soup-of-the-day shortcut to Siri. Your app can provide this option by making a shortcut suggestion.
Suggest a Shortcut
To suggest a shortcut to an action that the user hasn't performed but may want to add to Siri, create an
INShortcut object with either an
NSUser object that defines the action. Then add the shortcut to an array. Repeat for each suggestion your app wants to make. After creating the list of shortcut suggestions, call
set, passing in the shortcuts.
Your list of shortcut suggestions should represent actions that pertain to the user. This list may change over time for reasons such as:
The addition or removal of features from your app.
A change in the way the user interacts with your app.
To update the shortcut suggestion list, replace the existing list by calling
set and passing in a new list of suggestions. If you want to remove all suggestions made by your app, call the same method passing in an empty array.
Changes to the list of shortcut suggestions don't effect shortcuts the user adds to Siri. For instance, if the user adds the suggested order favorite beverage shortcut to Siri and the app removes the suggestion from the list some time later, that shortcut is still available to the user.