Skip to main content

Suggesting Shortcuts

Suggest shortcut for an activity if you would like an activity to appear in Siri Shortcuts without the user having to do it and thus before you'd donate it.

note

This is geared towards more general actions that you believe users may want to use in Shortcuts even if they haven't made use of it in your app.

API Definition

suggestShortcuts

Suggest multiple shortcuts that the user may want to use.

suggestShortcuts(options: ShortcutOptions[]): void;

Type Reference

ShortcutOptions

{
/** The activity type with which the user activity object was created. */
activityType: string;
/** An optional, user-visible title for this activity, such as a document name or web page title. */
title?: string;
/** A set of keys that represent the minimal information about the activity that should be stored for later restoration. */
requiredUserInfoKeys?: Array<string>;
/** A dictionary containing app-specific state information needed to continue an activity on another device. */
userInfo?: { [key: string]: any };
/** Indicates that the state of the activity needs to be updated. */
needsSave?: boolean;
/** A set of localized keywords that can help users find the activity in search results. */
keywords?: Array<string>;
/** A value used to identify the user activity. */
persistentIdentifier?: string;
/** A Boolean value that indicates whether the activity can be continued on another device using Handoff. */
isEligibleForHandoff?: boolean;
/** A Boolean value that indicates whether the activity should be added to the on-device index. */
isEligibleForSearch?: boolean;
/** A Boolean value that indicates whether the activity can be publicly accessed by all iOS users. */
isEligibleForPublicIndexing?: boolean;
/** The date after which the activity is no longer eligible for Handoff or indexing. In ms since Unix Epox */
expirationDate?: number;
/** Webpage to load in a browser to continue the activity. */
webpageURL?: string;
/** A Boolean value that determines whether Siri can suggest the user activity as a shortcut to the user. */
isEligibleForPrediction?: boolean;
/** A phrase suggested to the user when they create a shortcut. */
suggestedInvocationPhrase?: string;
/** Content type of this shorcut. Check available options at https://developer.apple.com/documentation/mobilecoreservices/uttype/uti_abstract_types */
contentType?: string;
/** An optional description for the shortcut. */
description?: string;
}