Skip to main content

Clearing Shortcuts

You can clear shortcuts that are no longer relevant to the user or the current application state.

This will remove them from Spotlight and Siri Suggestions, and will remove them from the Shortcuts App.

note

iOS does not allow your app to remove voice shortcuts that the user has already created. It's your choice on how to handle this, whether by ignoring the shortcut, or letting the user know it is no longer valid.

API Definition

clearAllShortcuts

Clears all the previously donated/suggested shortcuts.

Returns Promise<void>

caution
This method can throw if the device is running iOS <= 12.
clearAllShortcuts();

clearShortcutsWithIdentifiers

Clears donated/suggested shortcuts which persistentIndentifier match one of the provided identifiers.

Returns Promise<void>

caution
This method can throw if the device is running iOS <= 12.
clearShortcutsWithIdentifiers(identifiers: string[]);