Add Siri Shortcut in iOS App using Swift 4


Siri Shortcut in iOS App

In iOS  12 Apple provides the capability to add the Siri within the App where you can execute or perform a task by informing to Siri. Here we are taking the example of showing the cart data using


Cart Data means : It is viewcontroller class which show the cart item .

Siri Shortcut is basically a voice command where you have to registered first after that when the siri detect the same voice command then it will automatically execute your task.

For this Follows this Steps:

1: Create a Unique ID for Siri Shortcut :

Here we have taken the bundle ID of Application :

2: Create a class for Siri :

Here   we have created the CartShortcut Class , it will return the Siri Shortcut Object.

3: Now Go to Class where you have to give this feature , I have given this facility in my Setting class of App.

a: take UIButton  , name as Siri Shortcut or you can add the image.

b: take a UITableView where you can show the previous & current phrase of Siri Shortcut . you can edit or delete this phrase as well.

c:Write the Function of this class.

Note: Here we have taken the delegate of Siri Shortcut for Add & edit case

d: First we will check weather previous phrases are available or not , if available then show to user so they can edit or delete this.

Note: It will show all the available phrases on TableView.

here you can see, on click of any Cell we are calling edit shortcut class so that it will help to edit or delete this phrase.

List of available phrase:



On Click on that:


Now we are aware about the available phrase edit &  delete .


4: Now its time to Add the siri shortcut functionality.

create a Outlet of Button then write this:

Note: Now you can add the new siri shortcut in your App.


5: Lets go to handle this action.

when you add all the shortcut in your App then we have to handle this ,by which we can perform desired work for this.

a: Go to Appdelegate.swift class & write this.

it will match with siri shortcut ID that you have given on creation .

here We have managed through Notification Center so it will inform when it will be execute.


If you need any kind of help regarding Siri shortcut lets comment to Us .

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


  • Vishnu. KV
    Can I add Siri shortcut directly without showing Add to Siri button in INUIAddVoiceShortcutViewController ? My requirement is to add Siri shortcut automatically via code (backend) and just inform user that Siri shortcut is already added for this feature. Please help here.
    • siddhant kumar (Moderator)
      You can open INUIAddVoiceShortcutViewController without adding Add To Siri button but adding the shortcut need to be done via addVoiceShortcutViewController(:didFinish:) method manually. You can open the Siri Shortcut controller automatically but its delegate needs to be called manually via the user.
  • css.php

    We've bought a Shopware Extension which is a hybrid App, which we can now offer in the Google Play Store and the IOS App Store. I'am still impressed how fast and how sharp the support team leads us through every process of the App-Store clarification. Very fast and useful response.

    Markus Walter

    Markus Walter

    Founder, Das Apartment Living

    Talk to Sales


    Live Chat
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home