INShortcutAvailabilityOptions
INShortcutAvailabilityOptions
INShortcutAvailabilityOptions Structure of Intents Defined contexts in which an intent or activity might be relevant to a user.
struct INShortcutAvailabilityOptionsOverview
The system uses the set of availability options in a donated shortcut to provide the user with shortcuts relevant in a particular context or circumstance. For example, a meditation app could include an intent with sleepMindfulness in its //com.apple.documentation/documentation/Foundation/NSUserActivity/shortcutAvailability options when calling setShortcutSuggestions(:)). Then the Wind Down configuration screen in the Health app includes that intent in the Mindfulness category when guiding the user to set up shortcuts.
Provide accurate availability options when you suggest shortcuts to INVoiceShortcutCenter with setShortcutSuggestions(:)), and when you donate shortcuts based on user actions. If none of the options apply to an intent, provide an empty //com.apple.documentation/documentation/Swift/OptionSet.
Tip: Most shortcuts should specify a single activity type, but you can use an option set with more than one category if a shortcut really doesn’t fit neatly into a single category.
For more information on donating shortcuts effectively, see //com.apple.documentation/documentation/SiriKit/donating shortcuts.