Created
March 18, 2018 00:09
-
-
Save SheldonWangRJT/45b0fb57a08f9da297bf3b50e06a5f67 to your computer and use it in GitHub Desktop.
iOS - What does SiriKit do? How to use it in our app?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#iOSBySheldon | |
As Siri became more and more popular, people won't be satisfied to only use Siri in the iOS system level, instead, it will be much better if we can use Siri with apps that are not only from Apple. In WWDC 2016, Apple finally opened SiriKit to the developers. Time flies, it is almost two years past. I do believe in this year's WWDC 2018, Apple will give a big enhancement on the SiriKit. One of the bigger reason might be the release of the HomePod. | |
In this post, I don't want to show you any code, but I do want to explain to you guys what does SiriKit do and the basics of SiriKit.Same as Alex for Amazon and "OK Google", SiriKit uses a technique called Natural Language Processing. | |
If you check the link from WikiPedia, you will be find the following definition:"Natural-language processing (NLP) is an area of computer science and artificial intelligence concerned with the interactions between computers and human (natural) languages, in particular how to program computers to fruitfully process large amounts of natural language data."OK, to sumarize the paragraph, NLP is just an algorithm to make the communication between human and machine possible. And what SiriKit do is to process whatever you said into a intent. | |
I believe "intent" is the regular used term not only for Siri but also for Alexa and Google. As if today, SiriKit has the following available intents. | |
Lists - Create reminders, update a todo list | |
Messaging - Send messages | |
VoIP Calling - Make video / audio calls | |
Visual Codes - Display your QR code | |
Photo Search - Search photos with content types | |
Workouts - Start, pause workouts | |
Ride Booking - Book rides on taxi-like apps | |
Payments - Make payments to other persons or pay cards | |
Climate and Radio - CarPlay related climate and radio control | |
How do we make this work in our app? | |
When we integrate SiriKit in our app, we are building an Application Extension. Basically, we are extending iOS system Siri to be able to handle some voice commands for our app. You can treat the Extension is more like a part of system Siri than a part of our app. | |
Taking Make-Payment Intent as an example, (I have already made a video tutorial on this, please feel free to check it out here in Youtube), we need to create an intent class to handle few key information. | |
1. which app user wants to use to do the payments? | |
2. which card user wants to pay from? | |
3. how much user want to pay? | |
4. whom user wants to pay to? | |
Once all the info are collected you can trigger next step, maybe Touch ID auth to trigger the transaction.Again, please feel free to check my video tutorial here in Youtube, and the finished project is here in Github. | |
References: | |
Shttps://en.wikipedia.org/wiki/Natural-language_processing | |
https://www.youtube.com/watch?v=lWQhmcXm_sI | |
https://github.com/SheldonWangRJT/iOS-SiriKit-Demo | |
https://developer.apple.com/videos/play/wwdc2017/214/ | |
https://developer.apple.com/videos/play/wwdc2017/228/ | |
https://developer.apple.com/videos/play/wwdc2016/217/ | |
https://developer.apple.com/videos/play/wwdc2016/225/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment