getVoiceShortcut(with:completion:)
Retrieves a shortcut the user added to Siri.
Declaration
func getVoiceShortcut(with identifier: UUID, completion completionHandler: @escaping @Sendable (INVoiceShortcut?, (any Error)?) -> Void)func getVoiceShortcut(with identifier: UUID) async throws -> INVoiceShortcutParameters
- identifier:
The shortcut identifier.
- completionHandler:
The block invoked on a background thread after the system retrieves the shortcut. This block has no return value and takes the following parameters:
voiceShortcutAn instance of Invoiceshortcut representing the requested shortcut; otherwise,
nilif the shortcut doesn’t exist or an error occurs.errorAn Nserror object if a problem occurred retrieving the shortcut; otherwise,
nil.
Discussion
This method only retrieves shortcuts associated with the app that calls the method. It cannot retrieve shortcuts associated with other apps.