Home » sirikit

Tag: sirikit

SiriKit Tutorial – Right to the Point

In this tutorial you will learn how to get SiriKit working in your iOS App! To learn more about how SiriKit works behind the scenes, check out this article!

Requirements: Xcode 8, Swift 3 Project (this is what the tutorial is built on)

Part 1. Getting a quick and simple demo running

Create & setup iOS app

  1. Create a new ‘Single View Application’ Xcode Project. For this tutorial, lets use the project name “SiriKitDemo”
  2. Once the project is created and opened up, select your iOS app target in project settings.
  3. Enable the Siri capability under the “Capabilities” tab

 

capabilitiesshot

Now its time to add the intent files to your project

4. Select File –> New –> Target

5. Select “Intents Extension”

intents

6. Click Next and specify the name of your extension and configure the language and other options. ***For this tutorial, Check “Include UI Extension”***

intentdetails

Request access to Siri

7. Include the NSSiriUsageDescription key in your iOS app’s Info.plist file. The value for this key is a string that describes what information your app shares with SiriKit

infoplist

8. Open up your ViewController.swift file, import Intents and under viewDidLoad, call the requestSiriAuthorization: class method of INPreferences

viewcontroller-sirikit

Running & Testing

9. Select your iOS app’s target & Run your application

10. Select your Intent Extension and run that by attaching it to your iOS app

extensionrunning

11. Activate Siri and say “Search for messages in <appname>” —Siri should respond with what is listed in the IntentHandler.swift file

***Sometimes it takes a few minutes for Siri to process your extension, if it doesn’t work right away, don’t be alarmed***

 

Want to get a little bit more in depth? Learn how to add more intents, customize the way Siri handles intents, & more in Part 2!

 

 

[wpdevart_like_box profile_id=”364745913648633″ connections=”show” width=”300″ height=”550″ header=”small” cover_photo=”show” locale=”en_US”]